Nexaweb announces dojo.E markup and runtime
Nexaweb has released a new product that build on Dojo, dojo.E:
dojo.E provides developers with the ability to use an XML based markup language to add in their Ajax behaviors. Markup whether — XML, HTML or CSS — simplifies development by allow developers to convey in simple text format what they would otherwise need to convey in code. Markup also provides a great abstraction layer that separates the implementation from the usage.
This release, which is an Apache style open source project itself, consists of two pieces:
dojo.E Markup
dojo.E Markup allows developers to describe their dojo components using a simple markup language that translates directly into dojo classes. For example declaring a button in dojo would be done one of two ways;
HTML:
<div dojoType=”dijit.form.Button” label=”Hello, world”/>Using JavaScript
new dijit.form.Button(htmlElement, “Hello, World”);dojo.E Markup provides a third way that allows developers to describe the button as follows:
HTML:
<script type=“text/xml” dojoType=“dojoe.XmlScript”> <ui xmlns:dijit=“dijit”> <dijit :form.Button label=“Hello, World!” onclick=“alert(’It works!’)”/> </ui> </script>dojo.E Runtime
The runtime provides additional markup that makes modifying the HTML DOM or the dojo Components easier.
XML:
<xm :xmodify document=”ui”> </xm><xm :append select=”//widget.SortList”> <li>{0}</li> </xm>The xModify syntax above tells the dojo.E runtime to append a “
{0} ” tag to the dojo SortList component. The select statement in this case is a XPath statement and not a CSS selector. In the actual sample this snippet above is wrap with a “Macro” which allows the developer to parameterize the “{0}” and execute the xModify snippet when the developer clicks the “Add” button.
You can play with this in a live editor that shows samples such as a todo list:
XML:
<declarations> <dojoe :Macro id=“add” xmlns:dojoe=“dojoe”> <![CDATA[ <xm:xmodify xmlns="html" xmlns:xm="dojoe" xmlns:dijit="dijit" document="ui"> <xm :append select="//widget.SortList "> <li>{0}</li> </xm> ]]> </dojoe> </declarations> <ui xmlns:dijit=“dijit” xmlns:dojox=“dojox” xmlns=“html”> <div id=“input_container”> <span>ToDo:</span> <input style=“width: 184px; margin-left:3px;” id=“textbox” type=“text” class=“input_tbx” value=“Item”/> <input class=“button” type=“button” value=“Add” onclick=“dojoe.containers.macro.get(’add’).execute(document.getElementById(’textbox’).value);” /> </div> <div id=“list_container”> <dojox :widget.SortList title=“SortList From Markup” style=“width:300px; height:150px;”> <li>A. Download and Install the dojo.E</li> <li>B. Build dojo.E Application</li> <li>C. Profit</li> </dojox> </div> </ui>
(Via Ajaxian.)