1 / 14

Enhancing a Grid Portlet Using JavaScript

Enhancing a Grid Portlet Using JavaScript. Phil Chung Komla Etse John Nipp. Assignment Overview. Explore another way to create the portlet. 6a uses separate .java file for portlet’s logic.

yepa
Download Presentation

Enhancing a Grid Portlet Using JavaScript

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Enhancing a Grid Portlet Using JavaScript Phil Chung Komla Etse John Nipp

  2. Assignment Overview • Explore another way to create the portlet. • 6a uses separate .java file for portlet’s logic. • Use JavaScript to embed the Portlet’s logic directly in the code for the Portlet’s java server page (.jsp).

  3. Quick Overview of Java • Created by Netscape in 1995 • Purpose was to make web pages more interesting • An interpreted language • Scripts are not compiled prior to runtime • Statements processed at execution time • An object-based scripting language

  4. Implementing JavaScript in the Porlet Design • Still use the MainPage.jsp file • Include JavaScript within the HTML to create dynamic effects • Overcomes static nature of HTML.

  5. Installing JavaScript Libraries • Dojo Toolkit • Open source Dynamic-HTML (DHTML) toolkit written in JavaScript. • www.dojotoolkit.org

  6. Simple JavaScript Script Example of JavaScript instructions embedded within the HTML code <html> <head> <script type = “text/javascript”> Document.write(“This is file from inline HTML code.”) </script> </head> <body> </body> </html>

  7. <script type="text/javascript"> dojo.require("dojo.widget.TitlePane"); dojo.hostenv.writeIncludes(); dojo.require("dojo.widget.TabContainer"); dojo.require("dojo.widget.LinkPane"); dojo.require("dojo.widget.ContentPane"); dojo.require("dojo.widget.LayoutContainer"); dojo.require("dojo.widget.Checkbox"); dojo.require("dojo.widget.AccordionContainer"); dojo.require("dojo.widget.SplitContainer"); dojo.require("dojo.widget.*"); </script>

  8. <div class="main"> <div class="content" style="height:420px;"> <div dojoType="AccordionContainer" labelNodeClass="label" containerNodeClass="accBody" style="border: 1px solid #F9966B;HEIGHT:410px" id="mainaccordi"> <div id ="googlemap" dojoType="ContentPane" label="Google Map"> <form action="#" onsubmit="showAddress(this.address.value); return false"> <div id="googlemap2" style="width:1150px;height:300px"></div> <p> <b>Location:</b> <input type="text" size="60" name="address" value="1500 Marlynn Dr, Charlotte, NC" /> <input type="submit" value="Go!" /> </p> </form> </div> <div dojoType="SplitContainer" label="Email" open="true">

  9. Inserting JavaScript Code for Creation of Google Maps Interface <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIA AAAs91yCKatVZLSfyAUX3XJoxTwM0brOpm-All5BF6PoaKBxRWWERS2dI3 8LDyFef5VuB_jxekyAh-yXg" type="text/javascript"> </script>

  10. End

More Related