<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Eduzine© - Ajax</title>
    <link>http://eduzine.edujini-labs.com/</link>
    <description>Articles from Edujini Team</description>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:" />
    <generator>Serendipity 0.8.2 - http://www.s9y.org/</generator>
    <pubDate>Fri, 05 Sep 2008 00:09:42 GMT</pubDate>

    <image>
        <url>http://www.edujini-labs.com/images/newmasthead.gif</url>
        <title>RSS: Eduzine© - Ajax - Articles from Edujini Team</title>
        <link>http://eduzine.edujini-labs.com/</link>
        <width></width>
        <height></height>
    </image>
<item>
    <title>DWT - Take off and Problems Galore</title>
    <link>http://eduzine.edujini-labs.com/archives/38-DWT-Take-off-and-Problems-Galore.html</link>
<category>JavaScript</category><category>Dojo</category><category>Ajax</category><category>GWT</category><category>Web 2.0</category><category>Dojo GWT</category>    <comments>http://eduzine.edujini-labs.com/archives/38-DWT-Take-off-and-Problems-Galore.html#comments</comments>
    <wfw:comment>http://eduzine.edujini-labs.com/wfwcomment.php?cid=38</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://eduzine.edujini-labs.com/rss.php?version=2.0&amp;type=comments&amp;cid=38</wfw:commentRss>
    <author>eduzine@edujinionline.com (Eduzine)</author>
    <content:encoded>
&lt;p&gt;
The DWT project commenced about a fortnight back and soon hit some roadblocks.
&lt;/p&gt;

&lt;p&gt;
Firstly, the Ajax communication to the server in Google Web Toolkit is asynchronous and as such retrieving the templates in template based widgets was an issue. For which the team wrote a quick-fix to query the server synchronously. A function &lt;code&gt;getText&lt;/code&gt; was added to &lt;code&gt;com.edujinilabs.dwt.client.dojo.Dojo&lt;/code&gt; class (see &lt;a href=&quot;http://dwt.svn.sourceforge.net/viewvc/dwt/trunk/dwt/eclipse/src/com/edujinilabs/dwt/client/dojo/Dojo.java?revision=51&amp;view=markup&quot;&gt;the code here&lt;/a&gt;).
&lt;/p&gt;

&lt;p&gt;
Ok... that was an easy go. But then, we had the real fun!
&lt;/p&gt; 
&lt;p&gt;
Template-based Widgets rely on dynamically created properties (JavaScript is, after all, dynamically typed language). However, the first problem is that Java is statically typed; secondly, GWT changes the field/function names upon recompilation, and finally - Java does not support function references.
&lt;/p&gt;

&lt;p&gt;
A detailed problem description and proposed solution has been put up on the &lt;a href='http://dwt.sourceforge.net/blog/2008/08/29/template-based-widgets-in-dwt/'&gt;DWT Blog&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Have you got some suggestions or inputs? Do write in...
&lt;/p&gt;

    </content:encoded>
    <pubDate>Thu, 04 Sep 2008 15:28:12 -0700</pubDate>
    <guid isPermaLink="false">http://eduzine.edujini-labs.com/archives/38-guid.html</guid>
    </item>
<item>
    <title>Creating Custom Widget in Dojo - Part 1</title>
    <link>http://eduzine.edujini-labs.com/archives/32-Creating-Custom-Widget-in-Dojo-Part-1.html</link>
<category>Dojo</category><category>Ajax</category><category>Web 2.0</category><category>RIA</category>    <comments>http://eduzine.edujini-labs.com/archives/32-Creating-Custom-Widget-in-Dojo-Part-1.html#comments</comments>
    <wfw:comment>http://eduzine.edujini-labs.com/wfwcomment.php?cid=32</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://eduzine.edujini-labs.com/rss.php?version=2.0&amp;type=comments&amp;cid=32</wfw:commentRss>
    <author>eduzine@edujinionline.com (Eduzine)</author>
    <content:encoded>

&lt;p&gt;
Did you know that the &lt;a href=&quot;http://blogs.edujini-labs.com&quot;&gt;Edujini Gang&lt;/a&gt; is working on Dojo for more than a year now! Surprising right? Since there has been not a single entry on Dojo until the recent the &lt;a href=&quot;http://eduzine.edujini-labs.com/archives/29-Dojo-on-Google-Web-Toolkit.html&quot;&gt;recent announcement&lt;/a&gt; of the Project DWT (Dojo on Google Web Toolkit).
&lt;/p&gt;

&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;
&lt;a href=&quot;http://dojotoolkit.org&quot;&gt;Dojo Toolkit&lt;/a&gt; offers a simple yet powerful architecture to be able to create custom widgets. In Part 1 of the series of articles, we look at how to create a custom widget - probably with minimal styling and functionality.
&lt;/p&gt;

&lt;h2&gt;Downloads&lt;/h2&gt;

&lt;p&gt;
Yo! Buddy. The downloads are available in the &lt;a href=&quot;http://downloads.edujini-labs.com&quot;&gt;downloads area&lt;/a&gt;.
&lt;/p&gt;

 
&lt;h2&gt;What you should know...&lt;/h2&gt;

&lt;p&gt;
Well, you should be very comfortable with the following:
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;JavaScript - By the way, did you know that JavaScript is Object Oriented? No? Ok... Will provide some articles soon.&lt;/li&gt;
  &lt;li&gt;Defining custom objects (I will not use the term class) in JavaScript using Dojo Toolkit. If not, you can have a peek in at &lt;a href=&quot;http://api.dojotoolkit.org/jsdoc/dojo/HEAD/dojo.declare&quot;&gt;Dojo Documentation&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Getting Started&lt;/h2&gt;

&lt;p&gt;
Well, the first thing that you will need it Dojo Toolkit itself. You can download it from &lt;a href=&quot;http://dojotoolkit.org/downloads&quot;&gt;Dojo Downloads&lt;/a&gt;. And then, just a simple vanilla text editor - Notepad, TextPad, EditPlus, Notepad++ - just anything. &lt;img src=&quot;http://eduzine.edujini-labs.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;
&lt;/p&gt;

&lt;h2&gt;Widget Definition&lt;/h2&gt;

&lt;p&gt;
Let us create a simple widget that will just say &amp;quot;Hello, World!&amp;quot; (hard-coded) to start with, and subsequently, the content will be customizable.
&lt;/p&gt;


&lt;h2&gt;Widget Implementation&lt;/h2&gt;

&lt;p&gt;
I assume that the Dojo Toolkit library (downloaded earlier) has been extracted in the folder &lt;code&gt;/home/edujini/eduzine/dojo&lt;/code&gt;. Let us create another folder &lt;code&gt;/home/edujini/eduzine/dojo/edujini&lt;/code&gt;. I will not discuss, here in this article, on how to specify a custom location for custom definitions in Dojo. That is out of scope of this article.
&lt;/p&gt;

&lt;p&gt;
Within this sub-folder, create a file &lt;code&gt;CustomWidget.js&lt;/code&gt; with the following contents:
&lt;/p&gt;

&lt;pre&gt;/**&lt;br /&gt; &lt;strong&gt; Part of the Eduzine (http://eduzine.edujini-labs.com) Articles.&lt;br /&gt; &lt;/strong&gt;&lt;br /&gt; &lt;strong&gt; Downloads available at http://downloads.edujini-labs.com&lt;br /&gt; &lt;/strong&gt;&lt;br /&gt; &lt;strong&gt; (C) 2008, Edujini Labs Pvt Ltd&lt;br /&gt; &lt;/strong&gt; http://www.edujini-labs.com&lt;br /&gt; &lt;strong&gt;/&lt;br /&gt;&lt;br /&gt;dojo.provide('edujini.CustomWidget');&lt;br /&gt;dojo.require('dijit._Widget');&lt;br /&gt;&lt;br /&gt;dojo.declare(&amp;quot;edujini.CustomWidget&amp;quot;, dijit._Widget,&lt;br /&gt;{&lt;br /&gt;  postCreate : function()&lt;br /&gt;  {&lt;br /&gt;    this.domNode.innerHTML = 'Hello, World!';&lt;br /&gt;  }&lt;br /&gt;});&lt;/pre&gt;

&lt;p&gt;
One of the more important functions of the object &lt;code&gt;dijit._Widget&lt;/code&gt; is &lt;code&gt;postCreate&lt;/code&gt;. We override the method to provide our implementation and that is to simply set the &lt;code&gt;innerHTML&lt;/code&gt; of the container to the text &lt;code&gt;Hello, World!&lt;/code&gt;.
&lt;/p&gt;

&lt;h2&gt;Using Custom Widget&lt;/h2&gt;

&lt;p&gt;
Ok... now that we have got the widget, we do not know how and if it works. So, let's just write a simple test page (HTML) to use it. Create a file &lt;code&gt;/home/edujini/eduzine/custom-widget-test.html&lt;/code&gt; with the following contents.
&lt;/p&gt;

&lt;pre&gt;&amp;lt;html&amp;gt;&lt;br /&gt;  &amp;lt;head&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;Edujini Custom Widget Test&amp;lt;/title&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;script type=&amp;quot;text/javascript&amp;quot; language='javascript' src=&amp;quot;dojo/dojo/dojo.js&amp;quot; djConfig=&amp;quot;isDebug: true, parseOnLoad: true&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;    &amp;lt;script type='text/javascript' language='javascript'&amp;gt;&lt;br /&gt;      dojo.require('dijit.form.Button');&lt;br /&gt;      dojo.require('edujini.CustomWidget');&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;br /&gt;  &amp;lt;/head&amp;gt;&lt;br /&gt;  &amp;lt;body&amp;gt;&lt;br /&gt;  &amp;lt;!--&lt;br /&gt;    /**&lt;br /&gt;     &lt;/strong&gt; Part of the Eduzine (http://eduzine.edujini-labs.com) Articles.&lt;br /&gt;     &lt;strong&gt;&lt;br /&gt;     &lt;/strong&gt; Downloads available at http://downloads.edujini-labs.com&lt;br /&gt;     &lt;strong&gt;&lt;br /&gt;     &lt;/strong&gt; (C) 2008, Edujini Labs Pvt Ltd&lt;br /&gt;     &lt;strong&gt; http://www.edujini-labs.com&lt;br /&gt;     &lt;/strong&gt;/&lt;br /&gt;  --&amp;gt;&lt;br /&gt;    &amp;lt;div id='w1' dojoType='edujini.CustomWidget'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;  &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;

&lt;p&gt;
With this, the response that we expect is something as given below (I've highlighted the output using the red-ellipse. You'll not get it):
&lt;/p&gt;

&lt;p&gt;
&lt;img title=&quot;Eduzine - Dojo - Custom Widget - Simple - Output&quot; alt=&quot;Eduzine - Dojo - Custom Widget - Simple - Output&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/dojo/32.Dojo.Custom.Widget-1-01.Output.jpg&quot; /&gt;
&lt;/p&gt;

&lt;h2&gt;Customizing the Widget&lt;/h2&gt;

&lt;p&gt;
The next step is to customize the &lt;code&gt;Hello, World!&lt;/code&gt; with a user defined content. Let's say that the default value of the content to be displayed is &lt;code&gt;Hello, World!&lt;/code&gt;. To this effect, update the &lt;code&gt;CustomWidget.js&lt;/code&gt; as follows (changes highlighted in bold):
&lt;/p&gt;

&lt;pre&gt;dojo.declare(&amp;quot;edujini.CustomWidget&amp;quot;, dijit._Widget,&lt;br /&gt;{&lt;br /&gt;  &lt;b&gt;text: 'Hello, World!',&lt;/b&gt;

  postCreate : function()
  {
    this.domNode.innerHTML = &lt;b&gt;this.text;&lt;/b&gt;
  }
});
&lt;/pre&gt;

&lt;p&gt;
Simultaneously, we update the &lt;code&gt;custom-widget-test.html&lt;/code&gt; file to as follows:
&lt;/p&gt;

&lt;pre&gt;  &amp;lt;body&amp;gt;&lt;br /&gt;    &amp;lt;div id='w1' &lt;b&gt;text='Hello, Edujini World!'&lt;/b&gt; dojoType='edujini.CustomWidget'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;  &amp;lt;/body&amp;gt;&lt;/pre&gt;

&lt;p&gt;
And that's it! Look at the HTML file in the browser...
&lt;br /&gt;
&lt;img title=&quot;Eduzine - Dojo - Custom Widget - Simple - Custom Property&quot; alt=&quot;Eduzine - Dojo - Custom Widget - Simple - Custom Property&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/dojo/32.Dojo.Custom.Widget-1-02.Property.jpg&quot; /&gt;
&lt;/p&gt;

&lt;h2&gt;Summary&lt;/h2&gt;

&lt;p&gt;
In this article, we learnt:
&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;To create a custom widget using Dojo Toolkit.&lt;/li&gt;
	&lt;li&gt;To create a property that can be used subsequently in the widget.&lt;/li&gt;
	&lt;li&gt;Had a brief venture into the method &lt;code&gt;postCreate&lt;/code&gt; - one of the key methods. It it called after all entries from the HTML have been read and parsed. We shall look into the details of this method later on when we explore the lifecycle of Dojo Widgets.&lt;/li&gt;
&lt;/ul&gt;

    </content:encoded>
    <pubDate>Thu, 12 Jun 2008 00:00:00 -0700</pubDate>
    <guid isPermaLink="false">http://eduzine.edujini-labs.com/archives/32-guid.html</guid>
    </item>
<item>
    <title>Dojo on Google Web Toolkit</title>
    <link>http://eduzine.edujini-labs.com/archives/29-Dojo-on-Google-Web-Toolkit.html</link>
<category>JavaScript</category><category>Dojo</category><category>Ajax</category><category>GWT</category><category>Web 2.0</category><category>Edujini</category><category>Dojo GWT</category>    <comments>http://eduzine.edujini-labs.com/archives/29-Dojo-on-Google-Web-Toolkit.html#comments</comments>
    <wfw:comment>http://eduzine.edujini-labs.com/wfwcomment.php?cid=29</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://eduzine.edujini-labs.com/rss.php?version=2.0&amp;type=comments&amp;cid=29</wfw:commentRss>
    <author>eduzine@edujinionline.com (Eduzine)</author>
    <content:encoded>

&lt;p&gt;
&lt;b&gt;This is the updated version of the announcement - the License has been changed to &lt;a href=&quot;http://www.opensource.org/licenses/bsd-license.php&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;New BSD&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;
&lt;/p&gt;

&lt;p&gt;
To take the development experience with &lt;a href=&quot;http://dojotoolkit.org&quot;&gt;Dojo Toolkit&lt;/a&gt; on to the next level using &lt;a href=&quot;http://code.google.com/webtoolkit&quot;&gt;Google Web Toolkit&lt;/a&gt;, Edujini Labs plans to port Dojo Toolkit for GWT.
&lt;/p&gt;

&lt;p&gt;
The project would soon be hosted at SourceForge under both &lt;strike&gt;GPL v2/3&lt;/strike&gt; New BSD and commercial license. We have sought for the project name &amp;quot;DWT&amp;quot; (applied under APT process, and may take 2-3 weeks for complete takeover).
&lt;/p&gt;

&lt;br /&gt;

&lt;p&gt;
The project would be led by Gaurav Vaish, initially supported by core team comprising of
&lt;/p&gt;&lt;ul&gt;
  &lt;li&gt;Abdul Prodhani&lt;/li&gt;
  &lt;li&gt;Hair S Nair&lt;/li&gt;
  &lt;li&gt;Shake Sajan&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;

&lt;/p&gt;&lt;p&gt;
To get started, a quick proof-of-concept demo has been created. It's not a very clean implementation - just a get started stuff.
&lt;/p&gt;

&lt;p&gt;
&lt;object width=&quot;425&quot; height=&quot;350&quot;&gt; &lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/SdEdJskMe0g&quot; /&gt;  &lt;embed width=&quot;425&quot; height=&quot;350&quot; src=&quot;http://www.youtube.com/v/SdEdJskMe0g&quot; type=&quot;application/x-shockwave-flash&quot; /&gt;  &lt;/object&gt;
&lt;/p&gt;

&lt;p&gt;
The video for the demo is available can be &lt;a href=&quot;http://eduzine.edujini-labs.com/uploads/edujini/dwt/01.Dojo-GWT-Hello-World.avi&quot;&gt;downloaded here&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
You can support this project by spreading the word, to start with &lt;img src=&quot;http://eduzine.edujini-labs.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;. Just &amp;quot;Digg It&amp;quot;.&lt;br /&gt; Some people have reported problems with Digging the articles on Eduzine... if that's the case with you, &amp;quot;Digg This&amp;quot; - &lt;a href=&quot;http://blogs.edujini-labs.com/2008/05/30/dwt/&quot;&gt;http://blogs.edujini-labs.com/2008/05/30/dwt/&lt;/a&gt;
&lt;/p&gt;


     </content:encoded>
    <pubDate>Wed, 11 Jun 2008 11:15:00 -0700</pubDate>
    <guid isPermaLink="false">http://eduzine.edujini-labs.com/archives/29-guid.html</guid>
    </item>
<item>
    <title>Google Web Toolkit says, &quot;Hello, World!&quot; - Part 2</title>
    <link>http://eduzine.edujini-labs.com/archives/28-Google-Web-Toolkit-says,-Hello,-World!-Part-2.html</link>
<category>JavaScript</category><category>Ajax</category><category>GWT</category><category>Web 2.0</category><category>&quot;Hello, World!&quot;</category>    <comments>http://eduzine.edujini-labs.com/archives/28-Google-Web-Toolkit-says,-Hello,-World!-Part-2.html#comments</comments>
    <wfw:comment>http://eduzine.edujini-labs.com/wfwcomment.php?cid=28</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://eduzine.edujini-labs.com/rss.php?version=2.0&amp;type=comments&amp;cid=28</wfw:commentRss>
    <author>eduzine@edujinionline.com (Eduzine)</author>
    <content:encoded>

&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;
In the second article in the series - Google Web Toolkit says, &amp;quot;Hello, World!&amp;quot; - we learn how to do the same stuff in, probably, a more structured manner: use Eclipse IDE to write the code, compile and launch. So that we don't have to switch across the Java editor, command prompt and the browser.
&lt;/p&gt;

&lt;p&gt;And the code - available at downloads in the &lt;a href=&quot;http://downloads.edujini-labs.com/index.php?act=category&amp;id=26&quot;&gt;GWT&lt;/a&gt; category.
&lt;/p&gt; 
&lt;h2&gt;Getting Started&lt;/h2&gt;

&lt;p&gt;
The software required are:
&lt;/p&gt;&lt;ul&gt;
	&lt;li&gt;Java SDK from &lt;a href=&quot;http://java.sun.com/javase&quot;&gt;Sun Java&lt;/a&gt; Website&lt;/li&gt;
	&lt;li&gt;Eclipse IDE from &lt;a href=&quot;http://www.eclipse.org&quot;&gt;Eclipse&lt;/a&gt; website. If you are confused what to download, get the Eclipse IDE for Java EE developers &lt;a href=&quot;http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/europa/winter/eclipse-jee-europa-winter-win32.zip&quot;&gt;directly from here&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;Google Web Toolkit from &lt;a href=&quot;http://code.google.com/webtoolkit/&quot;&gt;Google Code&lt;/a&gt; Website&lt;/li&gt;
	&lt;li&gt;Apache Tomcat from &lt;a href=&quot;http://tomcat.apache.org&quot;&gt;Apache&lt;/a&gt; Website&lt;/li&gt;
	&lt;li&gt;Cypal Studio &lt;a href=&quot;http://www.cypal.in/studio&quot;&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;

&lt;/p&gt;&lt;h2&gt;Step 1: Creating Web Application&lt;/h2&gt;

&lt;p&gt;
First step is to create a &amp;quot;Dynamic Web Project&amp;quot; in Eclipse.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-01.NewProject.jpg&quot; alt=&quot;create a &quot; title=&quot;create a &quot; /&gt;
&lt;/p&gt;

&lt;p&gt;
Choose Web -&amp;gt; Dynamic Web Project.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-02.DWP.jpg&quot; alt=&quot;create a &quot; title=&quot;create a &quot; /&gt;
&lt;/p&gt;

&lt;p&gt;
Select appropriate Web Server Runtime - the &amp;quot;Target Runtime&amp;quot;. [If the only entry that you get is &amp;lt;none&amp;gt;, create a &amp;quot;New...&amp;quot; one. Point it to the Apache Tomcat folder.] From the &amp;quot;Configurations&amp;quot;, select &amp;quot;Cypal Studio GWT Project&amp;quot;.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-03.Cypal.Config.jpg&quot; alt=&quot;create a &quot; title=&quot;create a &quot; /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-04.Cypal.Facet.jpg&quot; alt=&quot;create a &quot; title=&quot;create a &quot; /&gt;
&lt;/p&gt;

&lt;p&gt;
Finally, provide a meaningful &amp;quot;Context Root&amp;quot;, or leave it as it.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-05.Web.Config.jpg&quot; alt=&quot;create a &quot; title=&quot;create a &quot; /&gt;
&lt;/p&gt;

&lt;p&gt;
Open the &amp;quot;Project Explorer&amp;quot; view. You should see similar to as shown below.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-06.Project.Explorer.jpg&quot; alt=&quot;create a &quot; title=&quot;create a &quot; /&gt;
&lt;/p&gt;

&lt;h2&gt;Step 2: Adding a Module&lt;/h2&gt;

&lt;p&gt;
Our web application is now ready. What we now need is to add the &amp;quot;HelloWorld&amp;quot; module as what we did through the &lt;code&gt;applicationCreator.cmd&lt;/code&gt; utility earlier. However, this time we will use the GUI.
&lt;/p&gt;

&lt;p&gt;
We need to add a new &amp;quot;GWT Module&amp;quot; to our application. Follow these steps:
&lt;/p&gt;

&lt;p&gt;
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
Add a new item:&lt;br /&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-07.AddItem.jpg&quot; alt=&quot;Eclipse: Add a New Item&quot; title=&quot;Eclipse: Add a New Item&quot; /&gt;
&lt;/li&gt;
&lt;li&gt;
Add a new Module:&lt;br /&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-08.Module.jpg&quot; alt=&quot;Eclipse: Add a New Item&quot; title=&quot;Eclipse: Add a New Item&quot; /&gt;
&lt;/li&gt;
&lt;li&gt;
Give the name of the package as &lt;code&gt;com.edujinilabs.tutorials.gwt.hw&lt;/code&gt; (note that there is no &lt;code&gt;'client'&lt;/code&gt; as we had earlier), and the name of the class as &lt;code&gt;HelloWorld&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;

&lt;/p&gt;&lt;p&gt;
The module has been added. The following artifacts would have been generated:
&lt;/p&gt;&lt;ul&gt;
	&lt;li&gt;Module definition file: &lt;code&gt;com/edujinilabs/tutorials/gwt/hw/HelloWorld.gwt.xml&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;HTML file: &lt;code&gt;com/edujinilabs/tutorials/gwt/hw/public/HelloWorld.html&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Implementation Code: &lt;code&gt;com/edujinilabs/tutorials/gwt/hw/client/HelloWorld.java&lt;/code&gt;&lt;/li&gt;
	&lt;li&gt;Empty package &lt;code&gt;com.edujinilabs.tutorials.gwt.hw.server&lt;/code&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;

&lt;/p&gt;&lt;h2&gt;Step 3: Hello World Implementation&lt;/h2&gt;

&lt;p&gt;
We, now, have the skeleton to push in our code. What we shall do is have a simple &lt;code&gt;Button&lt;/code&gt; on the click of which we shall show a simple &lt;code&gt;alert&lt;/code&gt;. Update the class &lt;code&gt;HelloWorld&lt;/code&gt; to the following code:
&lt;/p&gt;

&lt;pre&gt;package com.edujinilabs.tutorials.gwt.hw.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;

public class HelloWorld implements EntryPoint
{
    public void onModuleLoad()
    {
        Button helloBtn = new Button();
        helloBtn.setText(&amp;quot;Say Hello&amp;quot;);

        helloBtn.addClickListener(new ClickListener() {
            public void onClick(Widget sender)
            {
                Window.alert(&amp;quot;Hello, World!&amp;quot;);
            }
        });

        RootPanel.get().add(helloBtn);
    }
}
&lt;/pre&gt;

&lt;h2&gt;Step 4: Launching the Application&lt;/h2&gt;

&lt;p&gt;
We need to configure two things to launch and run the application. First, create a new &amp;quot;Run&amp;quot; configuration. Go to Run -&amp;gt; Run..., and follow these steps:
&lt;/p&gt;

&lt;p&gt;
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
Add a new configuration:&lt;br /&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-12.Run.Configurations.jpg&quot; alt=&quot;Eclipse: Add a New Run Configuration for GWT&quot; title=&quot;Eclipse: Add a New Run Configuration for GWT&quot; /&gt;
&lt;/li&gt;
&lt;li&gt;
Provide a meaningful name to the configuration. Choose the project (if not already chosen) and the module.&lt;br /&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-13.New.Configuration.jpg&quot; alt=&quot;Eclipse: Add a New Run Configuration for GWT&quot; title=&quot;Eclipse: Add a New Run Configuration for GWT&quot; /&gt;
&lt;/li&gt;
&lt;li&gt;
Select the &amp;quot;Parameters&amp;quot; tab and configure the memory to be provided on the heap:&lt;br /&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-14.RAM.Configuration.jpg&quot; alt=&quot;Eclipse: Add a New Run Configuration for GWT&quot; title=&quot;Eclipse: Add a New Run Configuration for GWT&quot; /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;

&lt;/p&gt;&lt;p&gt;
Click, optionally &lt;code&gt;Apply&lt;/code&gt; and then, &lt;code&gt;Run&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
Voila! We again the got the Google Web Toolkit Development Shell! Great, isn't it - noting that we did not touch anything outside Eclipse IDE this time.
&lt;/p&gt;

&lt;p&gt;
What next? Click on the button and &amp;quot;Say Hello&amp;quot;. &lt;img src=&quot;http://eduzine.edujini-labs.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/28.GWT.HelloWorld-Cypal-15.Output.jpg&quot; alt=&quot;Google Web Toolkit says, &quot; title=&quot;Google Web Toolkit says, &quot; /&gt;
&lt;/p&gt;


&lt;h2&gt;Summary&lt;/h2&gt;

&lt;p&gt;
We can use the Cypal Studio plug-in for Eclipse to ease our life working with GWT. Well, of course, the power lies with GWT.
&lt;/p&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    </content:encoded>
    <pubDate>Tue, 27 May 2008 15:31:49 -0700</pubDate>
    <guid isPermaLink="false">http://eduzine.edujini-labs.com/archives/28-guid.html</guid>
    </item>
<item>
    <title>Google Web Toolkit says, &quot;Hello, World!&quot; - Part 1</title>
    <link>http://eduzine.edujini-labs.com/archives/27-Google-Web-Toolkit-says,-Hello,-World!-Part-1.html</link>
<category>JavaScript</category><category>Ajax</category><category>GWT</category><category>Web 2.0</category><category>&quot;Hello, World!&quot;</category>    <comments>http://eduzine.edujini-labs.com/archives/27-Google-Web-Toolkit-says,-Hello,-World!-Part-1.html#comments</comments>
    <wfw:comment>http://eduzine.edujini-labs.com/wfwcomment.php?cid=27</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://eduzine.edujini-labs.com/rss.php?version=2.0&amp;type=comments&amp;cid=27</wfw:commentRss>
    <author>eduzine@edujinionline.com (Eduzine)</author>
    <content:encoded>

&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;
Google Web Toolkit (from Google, at &lt;a href=&quot;http://code.google.com/webtoolkit/&quot;&gt;Google Code&lt;/a&gt;) is a fantastic framework with a very interesting concept - write in Java run in JavaScript! This article demonstrates how to get started with Google Web Toolkit.
&lt;/p&gt;

&lt;p&gt;
The first part of the article demonstrates how to use the default tools provided in GWT to write the &amp;quot;Hello World&amp;quot; application. The second in the series will demonstrate how to use &lt;a href=&quot;http://www.cypal.in/studio&quot;&gt;Cypal Studio Plug-in&lt;/a&gt; for &lt;a href=&quot;http://www.eclipse.org&quot;&gt;Eclipse&lt;/a&gt; to make your life easy when it comes to creating, compiling and running GWT applications.
&lt;/p&gt;

&lt;p&gt;As usual, the code is available in the &lt;a href=&quot;http://downloads.edujini-labs.com&quot;&gt;Downloads&lt;/a&gt; section. Direct link to the Google Web Toolkit category is &lt;a href=&quot;http://downloads.edujini-labs.com/index.php?act=category&amp;id=26&quot;&gt;here&lt;/a&gt;.

&lt;/p&gt; 
&lt;h2&gt;What you need to know&lt;/h2&gt;

&lt;p&gt;
You will need to know Java, at the least because, as I mentioned earlier, majority of the code is written in Java. And please, no generics.
&lt;/p&gt;

&lt;h2&gt;Step 1: Getting Started&lt;/h2&gt;

&lt;p&gt;
Well, the first step is to download Java SDK, if you already don't have one. And then, you will need GWT.
&lt;/p&gt;

&lt;p&gt;
Here's the list, bulleted:
&lt;/p&gt;&lt;ul&gt;
	&lt;li&gt;Java SDK from &lt;a href=&quot;http://java.sun.com/javase&quot;&gt;Sun Java&lt;/a&gt; Website&lt;/li&gt;
	&lt;!--
	&lt;li&gt;Eclipse IDE from &lt;a href='http://www.eclipse.org'&gt;Eclipse&lt;/a&gt; website. If you are confused what to download, get the Eclipse IDE for Java EE developers &lt;a href='http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/europa/winter/eclipse-jee-europa-winter-win32.zip'&gt;directly from here&lt;/a&gt;.&lt;/li&gt;
	--&gt;
	&lt;li&gt;Google Web Toolkit from &lt;a href=&quot;http://code.google.com/webtoolkit/&quot;&gt;Google Code&lt;/a&gt; Website&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;

&lt;/p&gt;&lt;p&gt;I don't think there should be any trouble to download and install.&lt;/p&gt;

&lt;br /&gt;

&lt;h2&gt;Step 2: Looking at GWT&lt;/h2&gt;

&lt;p&gt;
Browse to the folder where you extracted Google Web Toolkit. The folder structure should be similar to shown below.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/01.GWT.HelloWorld-01-Folder-Structure.jpg&quot; title=&quot;Folder Structure of Google Web Toolkit&quot; alt=&quot;Folder Structure of Google Web Toolkit&quot; /&gt;
&lt;/p&gt;

&lt;br /&gt;

&lt;h2&gt;Step 3: Creating GWT Application&lt;/h2&gt;

&lt;p&gt;
The very first step that you will do with GWT, after all installation, is to create a GWT Application.
&lt;/p&gt;

&lt;p&gt;
If you look at the files, you will notice a file &lt;code&gt;applicationCreator.cmd&lt;/code&gt;. You guessed it right, that's our starting point.
&lt;/p&gt;

&lt;p&gt;
At the command prompt, go the folder and issue the following command:
&lt;/p&gt;

&lt;pre&gt;applicationCreator.cmd -out gwt-hello-world com.edujinilabs.tutorials.gwt.hw.clent.HelloWorld
&lt;/pre&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/01.GWT.HelloWorld-02-ApplicationCreator.jpg&quot; alt=&quot;Google Web Toolkit; applicationCreator.cmd -out gwt-hello-world com.edujinilabs.tutorials.gwt.hw.client.HelloWorld&quot; title=&quot;Google Web Toolkit; applicationCreator.cmd -out gwt-hello-world com.edujinilabs.tutorials.gwt.hw.client.HelloWorld&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;
You will notice a set of files created for you.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/01.GWT.HelloWorld-03-CreatedFiles.jpg&quot; alt=&quot;Google Web Toolkit; applicationCreator.cmd -out gwt-hello-world com.edujinilabs.tutorials.gwt.hw.client.HelloWorld; Created Files&quot; title=&quot;Google Web Toolkit; applicationCreator.cmd -out gwt-hello-world com.edujinilabs.tutorials.gwt.hw.client.HelloWorld; Created Files&quot; /&gt;
&lt;/p&gt;

&lt;br /&gt;

&lt;h2&gt;Step 4: Launching Application in 'Hosted' Mode&lt;/h2&gt;

&lt;p&gt;
Descend into the folder &lt;code&gt;gwt-hello-world&lt;/code&gt;. You will notice two files - &lt;code&gt;HelloWorld-compile.cmd&lt;/code&gt; and &lt;code&gt;HelloWorld-shell.cmd&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/01.GWT.HelloWorld-04-FolderHW.jpg&quot; title=&quot;Google Web Toolkit; Hello World&quot; alt=&quot;Google Web Toolkit; Hello World&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;
Launch &lt;code&gt;HelloWorld-shell.cmd&lt;/code&gt;. You will notice two windows opened - one titled &amp;quot;Google Web Toolkit Development Shell / Port 8888&amp;quot; and the other titled &amp;quot;Wrapper HTML for HelloWorld&amp;quot;.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/01.GWT.HelloWorld-05-WindowOne.jpg&quot; alt=&quot;Google Web Toolkit Development Shell / Port 8888&quot; title=&quot;Google Web Toolkit Development Shell / Port 8888&quot; /&gt;
&lt;br /&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/01.GWT.HelloWorld-06-WindowTwo.jpg&quot; alt=&quot;Wrapper HTML for HelloWorld&quot; title=&quot;Wrapper HTML for HelloWorld&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;
In the second window, click the button that reads &amp;quot;Click me&amp;quot;. Voila! It says, &amp;quot;Hello World!&amp;quot;.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/01.GWT.HelloWorld-07-SayHello.jpg&quot; alt=&quot;Google Web Toolkit says, &quot; title=&quot;Google Web Toolkit says, &quot; /&gt;
&lt;/p&gt;

&lt;h2&gt;Where's the code?&lt;/h2&gt;

&lt;p&gt;
If you go into the folder &lt;code&gt;gwt-hello-world/src/com/edujinilabs/tutorials/gwt/hw/client&lt;/code&gt;, you will notice &lt;code&gt;HelloWorld.java&lt;/code&gt;. Yes, that's where the original code is.
&lt;/p&gt;

&lt;h2&gt;Where's the JavaScript?&lt;/h2&gt;

&lt;p&gt;
Ok! I agree. Browsers do not, yet, natively run Java code. So, where's the JavaScript? It's hidden right now. Let's generate.
On the command prompt, issue the following command (in the same folder as where you issued &lt;code&gt;HelloWorld-shell.cmd&lt;/code&gt;:
&lt;/p&gt;

&lt;pre&gt;HelloWorld-compile.cmd
&lt;/pre&gt;

&lt;p&gt;
&lt;img src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/gwt/01.GWT.HelloWorld-08-Compile.jpg&quot; alt=&quot;Google Web Toolkit; HelloWorld-compile.cmd&quot; title=&quot;Google Web Toolkit; HelloWorld-compile.cmd&quot; /&gt;
&lt;/p&gt;

&lt;p&gt;
Descend into the folder &lt;code&gt;www/com.edujinilabs.tutorials.gwt.hw.HelloWorld&lt;/code&gt;. You will notice two files - &lt;code&gt;HelloWorld.html&lt;/code&gt; and &lt;code&gt;com.edujinilabs.tutorials.gwt.hw.HelloWorld.nocache.js&lt;/code&gt;. Now, that's where the code is.
&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;
Well, without getting into even a single line of code, we have been able to say, &amp;quot;Hello World!&amp;quot; using Google Web Toolkit. We have been able to get a peek into where the original Java code resides, and where do we get the compiled / generated JavaScript and HTML content.
&lt;/p&gt;

&lt;p&gt;
We shall explore Google Web Toolkit in greater depth in next articles. Keep watching the category &lt;a href=&quot;http://eduzine.edujini-labs.com/categories/20-GWT&quot;&gt;Google Web Toolkit / GWT&lt;/a&gt;
&lt;/p&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;

    </content:encoded>
    <pubDate>Mon, 26 May 2008 15:34:00 -0700</pubDate>
    <guid isPermaLink="false">http://eduzine.edujini-labs.com/archives/27-guid.html</guid>
    </item>
</channel>
</rss>
