<?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© - Dojo</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© - Dojo - 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 2: Templated Widgets</title>
    <link>http://eduzine.edujini-labs.com/archives/33-Creating-Custom-Widget-in-Dojo-Part-2-Templated-Widgets.html</link>
<category>Dojo</category><category>Web 2.0</category><category>RIA</category>    <comments>http://eduzine.edujini-labs.com/archives/33-Creating-Custom-Widget-in-Dojo-Part-2-Templated-Widgets.html#comments</comments>
    <wfw:comment>http://eduzine.edujini-labs.com/wfwcomment.php?cid=33</wfw:comment>
    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://eduzine.edujini-labs.com/rss.php?version=2.0&amp;type=comments&amp;cid=33</wfw:commentRss>
    <author>eduzine@edujinionline.com (Eduzine)</author>
    <content:encoded>

&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;
In the &lt;a href=&quot;http://eduzine.edujini-labs.com/archives/32-Creating-Custom-Widget-in-Dojo-Part-1.html&quot;&gt;Part 1&lt;/a&gt; of the series, we learnt how to get started with creating custom UI widgets using &lt;a href=&quot;http://dojotoolkit.org&quot;&gt;Dojo Toolkit&lt;/a&gt;. In Part 2, learn to separate the UI from the business logic. Technically, we learn how to use templates to design the UI using simple HTML while keeping the functionality as separate JavaScript code.
&lt;/p&gt;

&lt;h2&gt;Downloads&lt;/h2&gt;

&lt;p&gt;
The downloads, as ever, 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;Templated Widgets&lt;/h2&gt;

&lt;p&gt;
Dijit sub-framework in Dojo Toolkit provides a support for templated widgets through the object &lt;code&gt;dijit._Templated&lt;/code&gt;. Well, we do not inherit this but use as a mixin and choose &lt;code&gt;dijit._Widget&lt;/code&gt; as the parent object.
&lt;/p&gt;
 
&lt;h2&gt;Widget Definition&lt;/h2&gt;

&lt;p&gt;
For our purpose of demonstration, we create a simple anchor widget. Yes, it's the &lt;code&gt;&amp;lt;a href='...'&amp;gt;...&amp;lt;/a&amp;gt;&lt;/code&gt; thing!
&lt;/p&gt;

&lt;p&gt;
The widget supports the following properties:
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;href&lt;/code&gt;: The hyperlink to point to.&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;text&lt;/code&gt;: The text to be displayed to the end user.&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;target&lt;/code&gt;: The target window for the anchor (Optional).&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;title&lt;/code&gt;: Title for the anchor element (Optional).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Widget Implementation&lt;/h2&gt;

&lt;p&gt;
Assuming that you have the folder layout as in the previous article (&lt;a href=&quot;http://eduzine.edujini-labs.com/archives/32-Creating-Custom-Widget-in-Dojo-Part-1.html&quot;&gt;see here for reference&lt;/a&gt;), create a file &lt;code&gt;/home/edujini/eduzine/dojo/edujini/Anchor.js&lt;/code&gt; with the following contents.
&lt;/p&gt;

&lt;pre&gt;/**
 &lt;strong&gt; Part of the Eduzine (http://eduzine.edujini-labs.com) Articles.
 &lt;/strong&gt;
 &lt;strong&gt; Downloads available at http://downloads.edujini-labs.com
 &lt;/strong&gt;
 &lt;strong&gt; (C) 2008, Edujini Labs Pvt Ltd
 &lt;/strong&gt; http://www.edujini-labs.com
 &lt;strong&gt;/

dojo.provide(&amp;quot;edujini.Anchor&amp;quot;);
dojo.require(&amp;quot;dijit._Widget&amp;quot;);
dojo.require(&amp;quot;dijit._Templated&amp;quot;);

dojo.declare(&amp;quot;edujini.Anchor&amp;quot;, [dijit._Widget, dijit._Templated],
{
  text: '',
  href: '',
  target: '',
  title: '',

  templateString  : null,
  templatePath    : dojo.moduleUrl('edujini', 'templates/Anchor.html'),
});
&lt;/pre&gt;

&lt;p&gt;
Notice the following things in the component definition:
&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;The parent object is not a single entry &lt;code&gt;dijit._Wiget&lt;/code&gt; but an array comprising of &lt;code&gt;dijit._Widget&lt;/code&gt; and &lt;code&gt;dijit._Templated&lt;/code&gt;.&lt;/li&gt;
	&lt;li&gt;It contains two properties - &lt;code&gt;templateString&lt;/code&gt; and &lt;code&gt;templatePath&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
The intepretatin of the items in the array is as follows:
&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;The first entry indicates the parent object - in this case, &lt;code&gt;dijit._Widget&lt;/code&gt;.&lt;/li&gt;
	&lt;li&gt;The subsequent entries - in this case, only, &lt;code&gt;dijit._Templated&lt;/code&gt; - indicate the objects from where the properties have to be &amp;quot;borrowed&amp;quot; or &amp;quot;overridden&amp;quot;. For example, if both &lt;code&gt;dijit._Widget&lt;/code&gt; and &lt;code&gt;dijit._Templated&lt;/code&gt; have the method &lt;code&gt;buildRendering&lt;/code&gt;, the final definition that will survive is that of &lt;code&gt;dijit._Templated&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Template Definition&lt;/h2&gt;

&lt;p&gt;
How that we have initial definition (components) of the &lt;code&gt;edujini.Anchor&lt;/code&gt; widget ready, let's go ahead and design the layout. Create a file &lt;code&gt;/home/edujini/eduzine/dojo/edujini/templates/Anchor.html&lt;/code&gt; with the following contents:
&lt;/p&gt;

&lt;pre&gt;&amp;lt;span class='edujiniAnchor' dojoAttachPoint='domNode'
  &amp;gt;&amp;lt;a href='${href}' dojoAttachPoint='anchorNode'&amp;gt;${text}&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;
&lt;/pre&gt;

&lt;p&gt;
Ensure that there is not trailing newline after &lt;code&gt;&amp;lt;/span&amp;gt;&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
The interpretation of the layout is as follows:
&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;The complete definition is encapsulated in a &lt;code&gt;span&lt;/code&gt; which comprises of the anchor element.&lt;/li&gt;
	&lt;li&gt;The &lt;code&gt;href&lt;/code&gt; attribute of the anchor element has the value as that of the property &lt;code&gt;href&lt;/code&gt; of the object &lt;code&gt;edujini.Anchor&lt;/code&gt; (Syntax &lt;code&gt;${href}&lt;/code&gt;).&lt;/li&gt;
	&lt;li&gt;The content within the anchor element has the value as that of the property &lt;code&gt;text&lt;/code&gt; of the &lt;code&gt;edujini.Anchor&lt;/code&gt; object.&lt;/li&gt;
	&lt;li&gt;Note that we have still not made use of &lt;code&gt;target&lt;/code&gt; and &lt;code&gt;title&lt;/code&gt; properties. We need to have logic for it!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Test Case&lt;/h2&gt;

&lt;p&gt;
Let's create a file &lt;code&gt;/home/edujini/eduzine/dojo/test-templated-widget.html&lt;/code&gt; with the following content:
&lt;/p&gt;

&lt;pre&gt;&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Edujini Tempalted Widget Test Case&amp;lt;/title&amp;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;
    &amp;lt;script type='text/javascript' language='javascript'&amp;gt;
      dojo.require('dijit.form.Button');
      dojo.require('edujini.Anchor');
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
  &amp;lt;!--
    /**
     &lt;/strong&gt; Part of the Eduzine (http://eduzine.edujini-labs.com) Articles.
     &lt;strong&gt;
     &lt;/strong&gt; Downloads available at http://downloads.edujini-labs.com
     &lt;strong&gt;
     &lt;/strong&gt; (C) 2008, Edujini Labs Pvt Ltd
     &lt;strong&gt; http://www.edujini-labs.com
     &lt;/strong&gt;/
  --&amp;gt;
    &amp;lt;div id='a1' text='Hello, Edujini World!' href='http://www.edujini-labs.com' dojoType='edujini.Anchor'&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/pre&gt;

&lt;p&gt;
Launch the HTML file in the browser... expected UI is:
&lt;br /&gt;
&lt;img border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/dojo/33.Dojo.Custom.Widget-2.01.Initial.UI.jpg&quot; alt=&quot;Eduzine - Dojo - Custom Widget - Anchor&quot; title=&quot;Eduzine - Dojo - Custom Widget - Anchor&quot; /&gt;
&lt;/p&gt;


&lt;h2&gt;Finishing Touches&lt;/h2&gt;

&lt;p&gt;
The only functionality that remains is adding &lt;code&gt;target&lt;/code&gt; and/or &lt;code&gt;title&lt;/code&gt;, if provided. For that, we override the method &lt;code&gt;postCreate&lt;/code&gt; in &lt;code&gt;edujini.Anchor&lt;/code&gt;. The updated definition of the object is:
&lt;/p&gt;

&lt;pre&gt;dojo.declare(&amp;quot;edujini.Anchor&amp;quot;, [dijit._Widget, dijit._Templated],
{
  text: '',
  href: '',
  target: '',
  title: '',

  templateString  : null,
  templatePath    : dojo.moduleUrl('edujini', 'templates/Anchor.html'),

  &lt;b&gt;postCreate: function()
  {
    if(this.target)
    {
      this.anchorNode.setAttribute('target', this.target);
    }

    if(this.title)
    {
      this.anchorNode.setAttribute('title', this.title);
    }
  }&lt;/b&gt;
});
&lt;/pre&gt;

&lt;p&gt;
Let's also update the test case:
&lt;/p&gt;

&lt;pre&gt;&amp;lt;div id='a1' text='Hello, Edujini World!'
  &lt;b&gt;target='_edujini'
  title='Edujini Labs Home Page'&lt;/b&gt;
  href='http://www.edujini-labs.com'
  dojoType='edujini.Anchor'&amp;gt;&amp;lt;/div&amp;gt;
&lt;/pre&gt;

&lt;p&gt;
The expected UI is (after updates) is:
&lt;br /&gt;
&lt;img border=&quot;1&quot; src=&quot;http://eduzine.edujini-labs.com/uploads/technology/javascript/dojo/33.Dojo.Custom.Widget-2.02.Updated.UI.jpg&quot; alt=&quot;Eduzine - Dojo - Custom Widget - Anchor&quot; title=&quot;Eduzine - Dojo - Custom Widget - Anchor&quot; /&gt;
&lt;/p&gt;

&lt;h2&gt;Summary&lt;/h2&gt;

&lt;p&gt;
In this article, we learnt the following:
&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Create widgets with separated implementation for the layout (JavaScript) and the logic (HTML) - the &amp;quot;templated widgets&amp;quot;.&lt;/li&gt;
	&lt;li&gt;Declare properties in the widget definition (JavaScript) and use them in the template (HTML) - syntax being &lt;code&gt;${&lt;i&gt;property-name&lt;/i&gt;}&lt;/code&gt;.&lt;/li&gt;
	&lt;li&gt;How to set the attributes of the elements (well, that was plain vanilla W3C XML DOM API implementation in JavaScript), conditionally.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Next Steps...&lt;/h2&gt;

&lt;p&gt;
Well, from this side... the next steps would be fulfill the earlier promise of an article on JavaScript - demonstrating the OOPS implementation in JavaScript.
&lt;/p&gt;

    </content:encoded>
    <pubDate>Sat, 14 Jun 2008 00:00:00 -0700</pubDate>
    <guid isPermaLink="false">http://eduzine.edujini-labs.com/archives/33-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>
</channel>
</rss>
