<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Otaqui.Com &#187; dojo</title>
	<atom:link href="http://otaqui.com/blog/tag/dojo/feed/" rel="self" type="application/rss+xml" />
	<link>http://otaqui.com/blog</link>
	<description>Pete Otaqui's blog about web development and everything else</description>
	<lastBuildDate>Wed, 23 Jun 2010 09:55:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Dojo Toolkit Book Reviews &#8211; &#8216;Dojo: The Definitive Guide&#8217;, &#8216;Mastering Dojo&#8217; and &#8216;Dojo: Using The Dojo Javascript Library To Build Ajax Applications&#8217;</title>
		<link>http://otaqui.com/blog/96/dojo-toolkit-book-reviews-dojo-the-definitive-guide-mastering-dojo/</link>
		<comments>http://otaqui.com/blog/96/dojo-toolkit-book-reviews-dojo-the-definitive-guide-mastering-dojo/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 14:55:42 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/wp/2008/06/dojo-toolkit-book-reviews-dojo-the-definitive-guide-mastering-dojo/</guid>
		<description><![CDATA[Having been working extensively with the Dojo Toolkit, and found their documentation to be extremely useful &#8211; but not exhaustive. I was happy therefore to be able to get hold of the following of pre-release books about the toolkit: Dojo: The Definitive Guide Mastering Dojo Dojo: Using the Dojo JavaScript Library to Build AJAX Applications [...]]]></description>
			<content:encoded><![CDATA[<p>Having been working extensively with the <a href="http://dojotoolkit.org">Dojo Toolkit</a>, and found their <a href="http://doojtoolkit.org/docs">documentation</a> to be extremely useful &#8211; but not exhaustive. I was happy therefore to be able to get hold of the following of pre-release books about the toolkit:</p>
<ul>
<li><a href="http://oreilly.com/catalog/9780596516482/">Dojo: The Definitive Guide</a></li>
<li><a href="http://pragprog.com/titles/rgdojo/mastering-dojo">Mastering Dojo</a></li>
<li><a href="http://safari.oreilly.com/9780321563132">Dojo: Using the Dojo JavaScript Library to Build AJAX Applications</a></li>
</ul>
<p>All three books cover the core dojo library and dijit gui controls and also associated tools like the build system.</p>
<h3>Dojo: The Definitive Guide</h3>
<p><img src="http://otaqui.com/wp/wp-content/uploads/dojo_tdg.jpg" alt="Dojo: The Definitive Guide" style="float:left; margin-right:10px; margin-bottom:10px;" /></p>
<p>If I ever want to get a book on a subject and there is an O&#8217;Reilly Definitive Guide, I will choose that one &#8211; mostly based on having the Javascript and Actionscript equivalents.  I have to say though that I felt a bit let down with this version, as <acronym title="Dojo: The Definitive Guide">DTDG</acronym> isn&#8217;t as comprehensive as I&#8217;m used to from the series.  While the coverage is broad (more so than the other books in this review), it isn&#8217;t all that deep in some key areas &#8211; missing out on some of the gotcha&#8217;s that I have found indispensable when working with Dojo.</p>
<p>I should make it clear that book is very clearly written with clean and helpful examples.  It is also written with the clear intention of readers people build solid web applications beyond using Dojo.</p>
<p>DTDG does go into excellent detail about the Dojo environment &#8211; bootstrapping, the build system, the dijit life-cycle, browser utilities, OOP with Dojo, Event management and the Publish / Subscribe mechanism, Ajax / JSON / JSONP / JSON-RPC, and more besides.  I think few people who aren&#8217;t Dojo committers could read and grok the book without gaining considerable insight.
<p>This puts the book in context &#8211; it isn&#8217;t really for the average developer who wants to get an application up-and-running with Dojo.  I would say it is for someone who wants a deeper understanding of the structure of the library, rather than how to hack something together with it.  A good example is the explanation of dojo.byId(), a clear detailing of the vagaries of document.getElementById() &#8211; and why the former is more useful (however I&#8217;ll leave you to go and buy the book to find out the specifics ;).</p>
<h3 style="clear:left;">Mastering Dojo</h3>
<p><img src="http://otaqui.com/wp/wp-content/uploads/mastering_dojo.jpg" alt="Mastering Dojo" style="float:left; margin-right:10px; margin-bottom:10px;" /></p>
<p>I would recommend this book without hesitation.  I found it informative, helpful and really on-point while trying to create a fairly heavy application on top of Dojo.  Written in the usual Pragmatic Programmer style, it is as easy to read through a chapter as it is to dig into for a specific answer.</p>
<p>Perhaps one omission is the <acronym title="Dojo Objective Harness">DOH</acronym> (which the book incorrectly refers to as the Dojo Object Handler) &#8211; perhaps correctly citing the fact that it is out of it&#8217;s own scope.  Given that DOH is dojo agnostic (your project does need to use Dojo to be tested with DOH) I suppose that is fair enough, but I would love to have seen even an introductory chapter on it.</p>
<p>Mastering Dojo is structured in a slightly confusing way &#8211; confusing at least if you are used to The Book Of Dojo and it&#8217;s well worth searching for terms in the index (unless you&#8217;re reading a PDF!) when the chapter titles don&#8217;t look as though they contain what you need.</p>
<h3 style="clear:left;">Dojo: Using the Dojo JavaScript Library to Build AJAX Applications</h3>
<p><img src="http://otaqui.com/wp/wp-content/uploads/dojo_utdjsltbaa.jpg" alt="Dojo: Using the Dojo JavaScript Library to Build AJAX Applications" style="float:left; margin-right:10px; margin-bottom:10px;" /></p>
<p>I&#8217;m afraid to say that I wasn&#8217;t especially enamored of this book &#8211; from its tongue-tangling and strangely-chosen title onwards.  I felt that it missed a considerable amount about the basics of dojo &#8211; which is understandable given its title &#8211; without really giving enough detail or insight into building an RIA &#8211; which is not.</p>
<p>Using Dojo (the best shortening I can come up with) does give a reasonable introduction to dojo, and covers some of the fundamental forms of usage, but it really isn&#8217;t comparable to either of the previously covered titles.</p>
<p><em>Update 2008-07-03 : </em> Alex Russell, one of the core dojo committers has also <a href="http://alex.dojotoolkit.org/?p=682">reviewed these books</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/96/dojo-toolkit-book-reviews-dojo-the-definitive-guide-mastering-dojo/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reacting To Events with the Dojo Dijit Editor</title>
		<link>http://otaqui.com/blog/95/reacting-to-events-with-the-dojo-dijit-editor/</link>
		<comments>http://otaqui.com/blog/95/reacting-to-events-with-the-dojo-dijit-editor/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 15:15:47 +0000</pubDate>
		<dc:creator>pete</dc:creator>
				<category><![CDATA[Professional]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://otaqui.com/wp/2008/06/reacting-to-events-with-the-dojo-dijit-editor/</guid>
		<description><![CDATA[I was writing a custom set of validation routines for a form, and using Dojo&#8217;s Dijit.Editor component &#8211; and having some trouble attaching my &#8220;invalid&#8221; class and a tooltip to a &#8216;required&#8217; editor. There were several parts to the problem: Iframe Transparency in IE Targeting the containing div node, the editor&#8217;s iframe tag, and that [...]]]></description>
			<content:encoded><![CDATA[<p>I was writing a custom set of validation routines for a form, and using Dojo&#8217;s Dijit.Editor component &#8211; and having some trouble attaching my &#8220;invalid&#8221; class and a tooltip to a &#8216;required&#8217; editor.</p>
<p>There were several parts to the problem:</p>
<ul>
<li>Iframe Transparency in IE</li>
<li>Targeting the containing div node, the editor&#8217;s iframe tag, and that iframe&#8217;s body node</li>
<li>Ignoring the weird default content that Dojo, or possibly the browser itself, adds to the Editor (a &lt;br /&gt; tag, but with a special attribute in Mozilla browsers)</li>
<li>Removing the class once the user makes a change to the content</li>
</ul>
<p>Ignoring all the rest, and a lot of the specifics (since I&#8217;m sure there are better ways to achieve all this) I&#8217;m just going to note how to get use dojo.connect to respond to a &#8216;click&#8217; inside the editor area.  It&#8217;s worth noting that using the normal method&#8217;s you would expect <em>sort of</em> work &#8211; but only when you click on the Editor&#8217;s toolbar rather than the inside the editable area.  That being said, here you go:</p>
<p><code><br />
&lt;textarea dojoType="dijit.Editor" id="dijitEditor">Click Me&lt;/textarea&gt;<br />
&lt;script&gt;<br />
dojo.addOnLoad(function() {<br />
&nbsp;var dijitEditor = dijit.byId('dijitEditor');<br />
&nbsp;var eBody = dijitEditor.iframe.contentDocument.body;<br />
&nbsp;dojo.connect(eBody,'click',onEditorClick);<br />
});<br />
function onEditorClick() {<br />
&nbsp;alert('you clicked the editor window');<br />
}<br />
&lt;/script&gt;<br />
</code></p>
<p><strong>NB &#8211; Not IE-friendly</strong>.  This won&#8217;t work in IE because of the contentDocument property, which it doesn&#8217;t support &#8211; but you could use the document.frames[] array instead.  Note that the iframe&#8217;s id is widgetid+&#8217;_iframe&#8217; in all except Mozilla.  So something like this:</p>
<p><code><br />
dojo.addOnLoad(function() {<br />
&nbsp;var dijitEditor = dijit.byId('dijitEditor');<br />
&nbsp;var eBody;<br />
&nbsp;if ( dojo.isIE ) {<br />
&nbsp;&nbsp;eBody = document.frames['dijitEditor_iframe'].body;<br />
&nbsp;} else {<br />
&nbsp;&nbsp;eBody = dijitEditor.iframe.contentDocument.body;<br />
&nbsp;}<br />
&nbsp;dojo.connect(eBody,'click',onEditorClick);<br />
});<br />
</code></p>
<p>I really went down the rabbit hole for while chasing &#8216;ondijitclick&#8217; and the &#8216;events&#8217; / &#8216;captureEvents&#8217; properties of the Dijit.Editor, but ended up using this fairly straightforward custom method.</p>
]]></content:encoded>
			<wfw:commentRss>http://otaqui.com/blog/95/reacting-to-events-with-the-dojo-dijit-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
