Errata for Mastering Dojo
We try to keep our books accurate, but sometimes mistakes creep
in. This page lists the errors submitted by our astute readers.
If you've found a new error, please
submit it.
The latest version of the book is P2.0,
released over 3 years ago.
If you've bought a PDF of the book and would like to upgrade
it to this version (for free), visit your
home page.
| PDF |
Paper |
Description |
Found in |
Fixed in |
| 40 |
|
#43026: Bad page break at pg 40 -- one widow '}' on the page.--Charles R Martin
|
P2.0
30-Apr-10
|
|
| 45 |
|
#48792: So, ${url} is replaced with oneResult.url, and ${title} is replaced with oneResult.title.
Should be:
So, ${url} is replaced with urls.url, and ${title} is replaced with urls.title.
Since is describing example from page 44.--Wojciech Bednarski #48792: So, ${url} is replaced with oneResult.url, and ${title} is replaced with oneResult.title.
Should be:
So, ${url} is replaced with urls.ur ...more...
|
P2.0
21-Feb-12
|
|
|
46-48 |
#46855: The wish_list_grid example does not work with the current dojo code; the dojox.grid.Grid has to be changed to dojox.grid.DataGrid and the import of tundraGrid.css must be changed to /dojoroot/dojox/grid/resources/tundraGrid.css--Gerri Shaw #46855: The wish_list_grid example does not work with the current dojo code; the dojox.grid.Grid has to be changed to dojox.grid.DataGrid and the impo ...more...
|
P2.0
11-Apr-11
|
|
|
60 |
#48956: the Cigars JSONP example does not work anymore as Yahoo has switched off the WebSearchService in April 2011.
We can use a similar service by Google with a few changes in the script "yahoo_remote_script.html":
(I have marked the appropriate lines with // v=here)
...
<table id="grid" dojoType="dojox.grid.DataGrid" store="wishStore"
query="{ wishId: '*' }" clientSort="true">
<script type="dojo/connect" event="onRowClick" args="evt">
var searchTerms = this.getItem(evt.rowIndex).description;
dojo.io.script.get({
// v= here
url: "http:||ajax.googleapis.com/ajax/services/search/web",
content: {
// v= here
v: "1.0",
// v= here
q: searchTerms
},
timeout: 10000,
callbackParamName: "callback",
load: function(searchResult) {
listNode = dojo.byId("resultUl");
listNode.innerHTML = "";
// v=here
dojo.forEach(searchResult.responseData.results, function(result) {
var listItem = document.createElement("li");
listItem.innerHTML =
dojo.string.substitute(
// v= here
"<a href='${visibleUrl}'>${title}</a><br/>${content}",
result
);
listNode.appendChild(listItem);
});
},
error: function(text) {
alert("An error has occurred.");
return text;
}
});
</script>
<thead>
<tr>
<th field="description" width="15em">Cigar</th>
<th field="size">Length/Ring</th>
<th field="origin">Origin</th>
<th field="wrapper">Wrapper</th>
<th field="shape">Shape</th>
</tr>
</thead>
</table>
...--Wolfgang Kittenberger #48956: the Cigars JSONP example does not work anymore as Yahoo has switched off the WebSearchService in April 2011.
We can use a similar service by ...more...
|
P2.0
19-Mar-12
|
|
|
77.5 |
#50359: I am reading via epub so the page number might not be correct. You have an example:
"Bluggh! That middle assignment statement is nasty looking. Are the quotes balanced right? Are the subscripts off? You have to look awfully close to find out. So, we use a trick from dojo.string:
for (var i=0; i < urls.length; i++) {
var listItem = document.createElement("li");
listItem.innerHTML =
dojo.string.substitute("<a href='${url}'>${title}</a>", urls[i]);
listNode.appendChild(listItem);
}
That's much better. The dojo.string.substitute method takes the hash in oneResult and applies the properties to a template. This template uses ${...}-style placeholders. So, ${url} is replaced with oneResult.url, and ${title} is replaced with oneResult.title."
You don't actually name the hash oneResult until the next paragraph. In this paragraph the hash is "urls". Not a big deal but a little confusing at first.--Matthew Doerng #50359: I am reading via epub so the page number might not be correct. You have an example:
"Bluggh! That middle assignment statement is nasty loo ...more...
|
P2.0
12-Dec-12
|
|
| 124 |
|
#43027: Figure 6.4 has lost most of its label text.--Charles R Martin
|
P2.0
30-Apr-10
|
|
|
215 |
#47141: Appears to be missing semi-colon in line 13 of acme-corp0.js code source.
--docgeek
|
P2.0
31-May-11
|
|
| 329 |
|
#43100: Most places in the book, you pass the args as an array and make a point of telling the reader it must be an array.
Should be...
error: function(text) {
// A Toaster will catch this error and display it
dojo.publish("xhrError" ,
[{ message: text, type: "error" , duration: 0 }]
);
return text;
}--Jeff #43100: Most places in the book, you pass the args as an array and make a point of telling the reader it must be an array.
Should be...
error: fun ...more...
|
P2.0
05-May-10
|
|
|
491 |
#50432: I am not sure what goes wrong, but I tried this script to build layout programmatically but the layout doesn't work.
<baf/step1/obe/main.js)--Zach
|
P2.0
03-Jan-13
|
|
| 498 |
|
#43101: I'm not sure what you are trying to do with these two dojo.publish statements. The first parameter should be the topic name and not one parameter with an array right? Then possibly you were going to hitch this and contents?
dojo.publish(["beforeDisplaySubmenu" , this, contents]);
- dojo.forEach(contents, function(commandItem){
5 dojo.publish(["beforeDisplayItem" , this, commandItem]);
I can't tell what the subscriber to beforeDisplaySubmenu and beforeDisplayItem are expecting as parameters.--Jeff #43101: I'm not sure what you are trying to do with these two dojo.publish statements. The first parameter should be the topic name and not one param ...more...
|
P2.0
05-May-10
|
|
| 530 |
|
#46240: "Over the next few releases, DTL will gradually replace the older template system in the bundled Dijit components." This puzzles me - none of the Dijit components have converted to use DTL, even in DojoX. And I haven't seen this fact repeated elsewhere. I suspect it's misinformed and unfounded.
(Note: not sure which 2008 version I have.)--Alex Ehlke #46240: "Over the next few releases, DTL will gradually replace the older template system in the bundled Dijit components." This puzzles me - none of ...more...
|
B1.0
14-Jan-11
|
|