<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Declarative Syntax for Widgets</title>
	<atom:link href="http://ajaxian.com/archives/declarative-syntax-for-widgets/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/declarative-syntax-for-widgets</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/declarative-syntax-for-widgets/comment-page-1#comment-264070</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Tue, 27 May 2008 08:45:01 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/declarative-syntax-for-widgets#comment-264070</guid>
		<description>But if I use my text editor to replace leading spaces with nbsp entities, you get something pretty...

$page_slideShow = {
&#160;&#160;&#160;widgetClass:&#039;Uize.Widget.SlideShow&#039;,
&#160;&#160;&#160;slides:slidesPhotos,
&#160;&#160;&#160;children:{
&#160;&#160;&#160;&#160;&#160;&#160;slideImage:{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;widgetClass:&#039;Uize.Widget.Swap.Image&#039;,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;width:350,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;height:250,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;built:false
&#160;&#160;&#160;&#160;&#160;&#160;},
&#160;&#160;&#160;&#160;&#160;&#160;slideRating:{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;widgetClass:&#039;Uize.Widget.Bar&#039;,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;orientation:&#039;horizontal&#039;,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;minValue:0,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;maxValue:10
&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;}
};</description>
		<content:encoded><![CDATA[<p>But if I use my text editor to replace leading spaces with nbsp entities, you get something pretty&#8230;</p>
<p>$page_slideShow = {<br />
&nbsp;&nbsp;&nbsp;widgetClass:&#8217;Uize.Widget.SlideShow&#8217;,<br />
&nbsp;&nbsp;&nbsp;slides:slidesPhotos,<br />
&nbsp;&nbsp;&nbsp;children:{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;slideImage:{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;widgetClass:&#8217;Uize.Widget.Swap.Image&#8217;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width:350,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height:250,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;built:false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;slideRating:{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;widgetClass:&#8217;Uize.Widget.Bar&#8217;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;orientation:&#8217;horizontal&#8217;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;minValue:0,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maxValue:10<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;}<br />
};</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/declarative-syntax-for-widgets/comment-page-1#comment-264069</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Tue, 27 May 2008 08:43:24 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/declarative-syntax-for-widgets#comment-264069</guid>
		<description>&#160;&#160;&#160;OK, not having indentation officially sucks!</description>
		<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;OK, not having indentation officially sucks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/declarative-syntax-for-widgets/comment-page-1#comment-264068</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Tue, 27 May 2008 08:40:27 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/declarative-syntax-for-widgets#comment-264068</guid>
		<description>Oh, and here&#039;s an example page that uses the declarative syntax supported by the Uize.Widget.Page base class of the UIZE Framework...

http://uize.com/examples/slideshow-with-dissolve.html

The syntax used in this example page is as follows...

&lt;code&gt;
$page_slideShow = {
   widgetClass:&#039;Uize.Widget.SlideShow&#039;,
   slides:slidesPhotos,
   children:{
      slideImage:{
         widgetClass:&#039;Uize.Widget.Swap.Image&#039;,
         width:350,
         height:250,
         built:false
      },
      slideRating:{
         widgetClass:&#039;Uize.Widget.Bar&#039;,
         orientation:&#039;horizontal&#039;,
         minValue:0,
         maxValue:10
      }
   }
};
&lt;/code&gt;

JS modules for the widgets are loaded dynamically by the Uize.module method. A widget tree is defined in this declaration, looking as follows...

page
page.children.slideShow
page.children.slideShow.children.slideImage
page.children.slideShow.children.slideRating

Of course, the slide show widget also add its own child widgets for the navigation buttons.</description>
		<content:encoded><![CDATA[<p>Oh, and here&#8217;s an example page that uses the declarative syntax supported by the Uize.Widget.Page base class of the UIZE Framework&#8230;</p>
<p><a href="http://uize.com/examples/slideshow-with-dissolve.html" rel="nofollow">http://uize.com/examples/slideshow-with-dissolve.html</a></p>
<p>The syntax used in this example page is as follows&#8230;</p>
<p><code><br />
$page_slideShow = {<br />
   widgetClass:'Uize.Widget.SlideShow',<br />
   slides:slidesPhotos,<br />
   children:{<br />
      slideImage:{<br />
         widgetClass:'Uize.Widget.Swap.Image',<br />
         width:350,<br />
         height:250,<br />
         built:false<br />
      },<br />
      slideRating:{<br />
         widgetClass:'Uize.Widget.Bar',<br />
         orientation:'horizontal',<br />
         minValue:0,<br />
         maxValue:10<br />
      }<br />
   }<br />
};<br />
</code></p>
<p>JS modules for the widgets are loaded dynamically by the Uize.module method. A widget tree is defined in this declaration, looking as follows&#8230;</p>
<p>page<br />
page.children.slideShow<br />
page.children.slideShow.children.slideImage<br />
page.children.slideShow.children.slideRating</p>
<p>Of course, the slide show widget also add its own child widgets for the navigation buttons.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/declarative-syntax-for-widgets/comment-page-1#comment-264064</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Tue, 27 May 2008 05:52:42 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/declarative-syntax-for-widgets#comment-264064</guid>
		<description>The UIZE Framework supports declarative syntax for widgets using &quot;passive&quot; JSON objects inside script tags. Widgets declared in this way are adopted by the page widget (the main controller for the page). Any arbitrary structure of widgets can be declared in this way. What&#039;s more, multiple declarations are &quot;stitched&quot; together into a single tree, so declarations can be flexibly split apart, so that the data governing the widgets can come from various server generated components. You can use the &quot;children&quot; propery or not. Furthermore, UIZE allows merely data declaration for widgets that are created in the page widget construction code, so the declarative data is &quot;scooped&quot; out of the page and consumed by the corresponding widgets. UIZE avoids using non-standard attributes in the markup for data declaration. For one thing, UIZE believes in the goal of validation of documents. Additionally, 
attributes strings are rather limiting on the kind of data structure that ca n be specified for widgets. Try declaring a product grid widget&#039;s data records in HTML attributes! Good luck with that ;-)

http://www.uize.com</description>
		<content:encoded><![CDATA[<p>The UIZE Framework supports declarative syntax for widgets using &#8220;passive&#8221; JSON objects inside script tags. Widgets declared in this way are adopted by the page widget (the main controller for the page). Any arbitrary structure of widgets can be declared in this way. What&#8217;s more, multiple declarations are &#8220;stitched&#8221; together into a single tree, so declarations can be flexibly split apart, so that the data governing the widgets can come from various server generated components. You can use the &#8220;children&#8221; propery or not. Furthermore, UIZE allows merely data declaration for widgets that are created in the page widget construction code, so the declarative data is &#8220;scooped&#8221; out of the page and consumed by the corresponding widgets. UIZE avoids using non-standard attributes in the markup for data declaration. For one thing, UIZE believes in the goal of validation of documents. Additionally,<br />
attributes strings are rather limiting on the kind of data structure that ca n be specified for widgets. Try declaring a product grid widget&#8217;s data records in HTML attributes! Good luck with that ;-)</p>
<p><a href="http://www.uize.com" rel="nofollow">http://www.uize.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Malde</title>
		<link>http://ajaxian.com/archives/declarative-syntax-for-widgets/comment-page-1#comment-264060</link>
		<dc:creator>Malde</dc:creator>
		<pubDate>Mon, 26 May 2008 19:48:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/declarative-syntax-for-widgets#comment-264060</guid>
		<description>This definitely looks like a step in the right direction.
Funny, I was just trying to wrap my head around the perfect syntax for &lt;a href=&quot;http://joose-js.blogspot.com/2008/05/meta-classes-and-jquery.html&quot; rel=&quot;nofollow&quot;&gt;declarative declaration of widgets&lt;/a&gt; using Joose and jQuery.

I&#039;m not totally there yet. This is my work in progress using an abstract class for widgets and a custom meta class that defines the special class builder &quot;events&quot;:
&lt;code&gt;
Class(&quot;Button&quot;, {
    isa: Widget,
    
    has: {
        message: {
            init: &quot;hello world&quot;
        }
    },
    
    events: {
        click: function () {
            alert(this.message)
        },
        dblclick: function () {
            alert(&quot;please only click once :)&quot;)
        }
    }
})
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>This definitely looks like a step in the right direction.<br />
Funny, I was just trying to wrap my head around the perfect syntax for <a href="http://joose-js.blogspot.com/2008/05/meta-classes-and-jquery.html" rel="nofollow">declarative declaration of widgets</a> using Joose and jQuery.</p>
<p>I&#8217;m not totally there yet. This is my work in progress using an abstract class for widgets and a custom meta class that defines the special class builder &#8220;events&#8221;:<br />
<code><br />
Class("Button", {<br />
    isa: Widget,</p>
<p>    has: {<br />
        message: {<br />
            init: "hello world"<br />
        }<br />
    },</p>
<p>    events: {<br />
        click: function () {<br />
            alert(this.message)<br />
        },<br />
        dblclick: function () {<br />
            alert("please only click once :)")<br />
        }<br />
    }<br />
})<br />
</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

