Errata

Palm webOS: Rough Cuts Version

Errata for Palm webOS: Rough Cuts Version

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page 172
code sample

In this sample line of code the right parenthesis is missing, the "transaction" method seems incomplete:

this.db.transaction( .... the right parenthesis is missing

Note from the Author or Editor:
On page 172, there is an error with the code snippet. The correct snippet should be:

this.db.transaction( (function (transaction) {
transaction.executeSql('A BUNCH OF SQL', []);
transaction.executeSql('MORE SQL', [], this.successHandler.bind(this),
this.errorHandler.bind(this));
})).bind(this);

Gabe Balogh  Jan 18, 2010 
Printed
Page 170
Section "Creating Large Databases"

"By default, Palm webOS stores databases within a size-constrained local file store,
which is the reason that HTML 5 databases are restricted to a 1MB maximum."

Does this still hold true or it changed in December 2009 with webOS 1.3.5 ?

Note from the Author or Editor:
This was changed with webOS 1.3.5. You can request that the database be created in the /media partition where database size is not limited by the system, only by available storage space. By default, a database will be created in the internal partition and constrained by the 1mbyte limit, but you can override this by specifying a prefix 'ext:' on the database name property. For example, this creates the News app's depot in the media partition:

this.db = new Mojo.Depot(
{name:"ext:feedDB", version:1, estimatedSize:100000, replace: false},
this.loadFeedDbOpenSuccess.bind(this),
this.loadFeedDbOpenFailure.bind(this)
);

Gabe Balogh  Jan 17, 2010 
Printed
Page 165
1st paragraph

A user should be instructed to include this new line in the sources.json:

{"source": "app/models/cookie.js"}

Note from the Author or Editor:
On page 166, preceding the final paragraph, add:

Don't forget to update sources.json with:

{
"source" : "app/models/cookie.js"
},

Gabe Balogh  Jan 17, 2010 
Printed
Page 166
1st paragraph

The sentence "After creating the cookie in our sample, this.cookie.get() is called to retrieve it." should read as "After creating the cookie in our sample, this.cookieData.get() is called to retrieve it.

Note from the Author or Editor:
On page 166, the 1st paragraph reads:

After creating the cookie in our sample, this.cookie.get() is called to retrieve it. If the cookie exists, the global preferences are updated with the stored values.

It should read:

After creating the cookie in our sample, this.cookieData.get() is called to retrieve it. If the cookie exists, the global preferences are updated with the stored values.

Gabe Balogh  Jan 17, 2010 
Printed
Page 136
5th paragraph

"It?s best to use an interval timer. At each interval callback, increase the progress indicator?s
value property and call the updateModel function."

The text says to call the updateModel function but the sample code below actually uses modelChanged() controller method. Where does the updateModel function come from?

Note from the Author or Editor:
On page 136, the 5th paragraph begins:

It?s best to use an interval timer. At each interval callback, increase the progress indicator?s value property and call the updateModel function.

It should read:

It?s best to use an interval timer. At each interval callback, increase the progress indicator?s value property and call the modelChanged function.

Gabe Balogh  Jan 10, 2010 
Printed
Page 133
3rd paragraph

I believe the sentence

"There?s one other place where a new feed list entry is created; in the checkOk method of addDialog-assistant.js:"

should read like this:

"There?s one other place where a new feed list entry is created; in the checkSuccess method of AddDialogAssistant object in the feedList-assistant.js:"

Note from the Author or Editor:
On page 133, the 3rd paragraph reads:
There?s one other place where a new feed list entry is created; in the checkOk method of addDialog-assistant.js:

It should read:
There?s one other place where a new feed list entry is created; in the checkSuccess method of addDialog-assistant.js:

Gabe Balogh  Jan 10, 2010 
Printed
Page 133
2nd paragraph

I believe the correct filename is feeds.js not stage-assistant.js

"The feedList default data is defined at the beginning of the stage-assistant.js." should say "The feedList default data is defined in the feeds.js"

Note from the Author or Editor:
On page 133, the second paragraph begins:
The feedList default data is defined at the beginning of the stage-assistant.js.

It should read:
The feedList default data is defined at the beginning of the feeds.js.

Gabe Balogh  Jan 10, 2010 
Printed
Page 87
1st paragraph from the bottom

"Add the Text Field declarations within a styled palm-group into the
feedList-scene.html file."

Perhaps the class was supposed to be palm-list instead of palm-group.
The palm-group doesn't appear in the feedList-scene.html file.

Note from the Author or Editor:
On page 88, the fourth paragraph begins:
Add the Text Field declarations within a styled palm-group into the feedList-scene.html file.

it should read:
Add the Text Field declarations within a styled palm-list class in the feedList-scene.html file.

GBGGG  Dec 29, 2009 
Printed
Page 84
2nd paragraph

The 2nd paragraph says "you can listen to Mojo.Event.propertyChange on the List."

However, the List widget is NOT listed as one of the supported widgets in the SDK documentation for the Mojo.Event.propertyChange

Note from the Author or Editor:
On page 84, the 2nd paragraph says "you can listen to Mojo.Event.propertyChange on the List." This should read "you can listen to Mojo.Event.listChange on the List."

GBGGG  Dec 28, 2009 
Printed
Page 81
1st paragraph

In order to see the unread count (shown in the white badge on
each feed) change to reflect the number of stories read in each feed,
open the feeds.js , find all unreadStyle and replace with unReadStyle string, especially inside the processFeed() method.

Note from the Author or Editor:
On page 45, replace four lines that read:
unReadStyle: "unReadStyle",

with:
unreadStyle: "unReadStyle"

GBGGG  Dec 28, 2009 
Printed
Page 69
Before the paragraph "Back to the News: Ajax requests"

You should advise a user to update the news.css file and include the following:

.palm-row-wrapper > .unReadStyle {
font-weight: bold;
}

Note from the Author or Editor:
On page 69, add this code snippet to the end of the last code snippet:

.palm-row-wrapper > .unReadStyle {
font-weight: bold;
}

GBGGG  Dec 26, 2009 
Printed
Page 299
last line

The 'allowHTMLMessage" argument to the Mojo.Controller.SceneController.showAlertDialog() is shown as "allHTMLMessage".

Note from the Author or Editor:
On page 299, book 1st printing, under Mojo.Controller.SceneController.showAlertDialog() in the Arguments table:

Replace
allHTMLMessage

With
allowHTMLMessage

Tim Marshall  Dec 22, 2009 
Printed
Page 38
2nd paragraph

I believe the function name in the 2nd paragraph in the text should read getElementById() instead of getElement()

Note from the Author or Editor:
On PDF and Book, page 38, 2nd paragraph:

Replace:
getElement()

With:
getElementById()

GBGGG  Dec 16, 2009 
Printed
Page 2
Figure 1-1

Description for the righmost model.
Perhaps the author meant to say "AJAX Web Application Model" instead of "Classic Web Application Model"

Note from the Author or Editor:
On Page 2 of the book, update Figure 1-1. Within the figure, the right-most instance of 'Classic Web Application Model' should read 'Ajax Application Model'.

Gabe  Dec 08, 2009 
Printed
Page 64
3rd paragraph from the bottom

The word "principle" in "the principle webOS architects were challenged..." should be spelled as "principal".

Note from the Author or Editor:
As noted by the reader, within the preface of all editions, the phrase:

"the principle webOS architects were challenged..." should spell the words as "principal".

Mark Y  Oct 24, 2009 
Printed
Page 67
First paragraph

The first paragraph states that the templates described on the prior page will result in a List widget with the appearance shown in Figure 3-6. Figure 3-6 shows a slider widget. I believe the intended figure was Figure 3-7 (shown 3 pages later on page 70).

First Edition

Note from the Author or Editor:
On both 1st and 2nd Printing of the book and PDF, page 67 includes a reference to Figure 3-6 that should refer to Figure 3-7. Specifically:

Replace:
Taken together, the scene?s view or HTML files wrap the List widget with some specific styles to get the visual appearance shown in Figure 3?6.

With:
Taken together, the scene?s view or HTML files wrap the List widget with some specific styles to get the visual appearance shown in Figure 3?7.

Jay Nabedian  Oct 07, 2009 
Printed
Page 58
Widget Event Handling section

In the example for the Widget Event Handling section, 'this' is capitalized as 'This'.

This code is not part of the application being developed throughout the book, but in case someone uses this example as reference for creating a listener the case should still be corrected.

Note from the Author or Editor:
Both 1st and 2nd Printing, on page 58 the code sample, the 'this' keyword is incorrectly capitalized:

Replace:
This.controller.listen("my-toggle", Mojo.Event.propertyChange
this.handleSelectorChange.bindAsEventListener(this));

With:
this.controller.listen("my-toggle", Mojo.Event.propertyChange
this.handleSelectorChange.bindAsEventListener(this));

Soyle Mycelf  Oct 06, 2009 
Printed
Page 45
In the code

Throughout the code stories.unreadStyle is used but it is defined in the array as stories.unReadStyle.

Note from the Author or Editor:
In both the 1st and 2nd printings, throughout the printed code samples, there are types which refer to "unreadStyle" in both a string form and as a property name within the stories arrays. All references should capitalize the "R" as "unReadStyle".

Brian Peletz  Sep 30, 2009 
Printed
Page 132
6th paragraph (code block)

A closing bracket was missed.
The line: <div x-mojo-element="Spinner" class="right" name="feedSpinner"</div>

Should be: <div x-mojo-element="Spinner" class="right" name="feedSpinner"></div>

Very minor. If copy and pasting exactly, then there'd be a problem. Most everyone even reading this is going to know to close the tag.

Note from the Author or Editor:
Chapter 5, section 'Spinners', page 132 (book, 1st printing), replace:
<div x-mojo-element="Spinner" class="right" name="feedSpinner"</div>

With
<div x-mojo-element="Spinner" class="right" name="feedSpinner"></div>

Anonymous  Sep 29, 2009 
Printed
Page 294
Attribute properties of "Text Field" widget

The "multiline" attribute is omitted from the list of available attributes. (From the official SDK, the Type is Boolean and the Description is "Auto line wrapping to field width".)

Note from the Author or Editor:
Appendix B, page 294 (PDF/Book):

Insert new row between inputName and charsAllow row for the multiLine property:

inputName String If supplied, the textarea will have this DOM name, so that when it is serialized, the property can be easily pulled out
multiline Boolean Auto line wrapping to field width
charsAllow Function Function must return 'true' to allow input character, or 'false' if not allowed;

DeusInnomen  Aug 27, 2009 
Printed
Page 37
Listing

Javascript does not allow multi-line quoted literal strings without escaping the CR/LF or concatenating. Typing in the example exactly as listed fails to run.

Rather than text like:

someVar = "this is a very long string that cannot fit
on one printed line";

it should read:

someVar = "this is a very long string that cannot fit" +
"on one printed line";

or (and this is apparently not valid in strict ECMAScript):

someVar = "this is a very long string that cannot fit \
on one printed line";

This error exists in both the PDF and the printed version.

Note from the Author or Editor:
Chapter 2, Section 'Adding the First Scene; The scene assistant', page 37(book):

In the code sample, replace:
"A number of municipalities across the country are getting creative and
experimenting with incremental, neighborhood- or district-based lending
programs that help homeowners pay the up-front capital costs for efficiency
or renewable energy projects.";

with:
"A number of municipalities across the country are getting creative and " +
"experimenting with incremental, neighborhood- or district-based lending " +
"programs that help homeowners pay the up-front capital costs for efficiency " +
"or renewable energy projects.";

alanhoyle  Aug 15, 2009 
PDF
Page 171
StageAssistant.prototype.setup code block

While working thru adding cookies, the author presents changes to the setup of StageAssistant. This does include the new call to News.Cookie.initialize. However, it also includes a call to this.feeds.loadFeedDb();

At this point in the book the author has not covered the topic of Depot and having this line in will break the users attempting to run it.

What should happen:

this.feeds.loadFeedDb(); line should be omitted from the StageAssistant.prototype.setup code example.

It is mentioned on page 173 to add it for the Depot support so it is covered as far as notifying the users that it needs to be added.

Note from the Author or Editor:
Chapter 6, Section 'Back to the News: Adding a Cookie', page 166 (book).

Remove this line from the stage assistant's setup method code sample:

this.feeds.loadFeedDb();

It should not appear in the application until the next section on 'Working with the Depot'.

Kenneth Brooks  Aug 15, 2009 
PDF
Page 172
First Paragraph

It is important for users to be able to make the changes as suggested in the book & see them run before tackling the next addition.

With that in mind, while the author mentions that "The
storeCookie() method is called anytime the preferences change." and proceeds to give one example, it would be nice to just list all the places the changes are required.

In this case it is only 1 additional location so it should be acceptable to do so.

What should happen:

Also add the following right below the code sample for PreferencesAssistant.prototype.deactivate:

feed-list-assistant.js: add News.Cookie.storeCookie(); to the last line of the toggleFeatureDrawer method

Note from the Author or Editor:
Chapter 6, Section: 'Back to the News: Adding a Cookie', page 166 (book).

Amend the copy shown as:
The storeCookie() method is called anytime the preferences change. For example, the deactivate() method in preferences-assistant.js will update the cookie when the Preferences scene is popped:
// Deactivate - save News preferences and globals
PreferencesAssistant.prototype.deactivate = function() {
News.Cookie.storeCookie();
};

The only other time you will need to update the cookie is in feedList-assistant.js at the end of the toggleFeatureDrawer() method, following the call to modeChanged():
this.controller.modelChanged(this.featureFeedDrawer);
News.Cookie.storeCookie(); // Save featureFeedEnable state

Kenneth Brooks  Aug 15, 2009 
PDF
Page 162
5.5.1.1 2nd Paragraph

The author is talking about the use of WebView widget.
He then instructs the users to create a new scene called webView as such:

Create a new scene, called webView, using
palm-generate, then declare the widget in
your scene view and configure it in your scene assistant before calling
setupWidget().
The storyWeb-scene.html is just one line:
<div id="storyWeb" x-mojo-element="WebView"></div>

However, all the following references are for 'storyWeb'.

What should happen:

Change the text in the paragraph to say "Create a new scene called storyWeb, using palm-generate ....

Note from the Author or Editor:
Chapter 5, section 'WebView', page 156 (book), replace:
Create a new scene, called webView, using palm-generate, ...

With
Create a new scene, called storyWeb, using palm-generate, ...

Kenneth Brooks  Aug 15, 2009 
PDF
Page 149
Back to the News

The following block of code gets a handle to featureStoryTitleElement but in the next line the innerHTML is attempted to be set on featureStoryElement. This hasn't been created until the line after that.

var featureStoryTitleElement = this.controller.get("featureStoryTitle");
// ** These next two lines are wrapped for book formatting only **
featureStoryElement.innerHTML =
unescape(this.feeds.list[this.featureIndexFeed].stories[
this.featureIndexStory].title);
var featureStoryElement = this.controller.get("featureStory");
featureStoryElement.innerHTML = summary;


What should happen:

change the first reference of featureStoryElement.innerHTML from featureStoryElement to featureStoryTitleElement

var featureStoryTitleElement = this.controller.get("featureStoryTitle");
// ** These next two lines are wrapped for book formatting only **
featureStoryTitleElement.innerHTML =
unescape(this.feeds.list[this.featureIndexFeed].stories[
this.featureIndexStory].title);
var featureStoryElement = this.controller.get("featureStory");
featureStoryElement.innerHTML = summary;

Note from the Author or Editor:
Chapter 5, Back to the News: Adding a featured feed Scroller, page 143 (pdf):

Replace:
// ** These next two lines are wrapped for book formatting only **
featureStoryElement.innerHTML =
unescape(this.feeds.list[this.featureIndexFeed].stories[
this.featureIndexStory].title);

With:
// ** These next two lines are wrapped for book formatting only **
featureStoryTitleElement.innerHTML =
unescape(this.feeds.list[this.featureIndexFeed].stories[
this.featureIndexStory].title);

Kenneth Brooks  Aug 13, 2009 
PDF
Page 149
Back to the News

FeedListAssistant.prototype.showFeatureStory has references to News.featureStoryTime such as:

if (News.featureStoryTimer === null)

The user was never instructed to add that to the stage-assistant.
As a result, the above code is actually checking News.featureStoryTimer for null when its currently 'undefined'.

What should happen:

User should be instructed to add

News.featureStoryTimer = null;

to the stage-assistant globals.

Note from the Author or Editor:
Chapter 5, Section "Back to the News: adding a featured feed Scroller", page 142 (book). Replace:
We set the timer default to 5 seconds (5000 milliseconds) in News.featureStoryInterval, another new global variable, added to stage-assistant.js.

With:
We set the timer default to 5 seconds (5000 milliseconds) in
News.featureStoryInterval, another new global variable, added to stage-assistant.js along with News.featureStoryTimer, which should be initialized to null.

Kenneth Brooks  Aug 13, 2009 
PDF
Page 149
First Paragraph

The first line of the paragraph states:

Create the
showFeed() method to present the feature story and set up the timer for the
next story.


What I should see:

Create the
showFeatureStory() method to present the feature story and set up the timer for the
next story.

Note from the Author or Editor:
Chapter 5, section "Back to the News: Adding a feature feed Scroller", page 142 (book). Replace the sentence:
Create the showFeed() method to present the feature story and set up the timer for the next story.

With:
Create the showFeatureStory() method to present the feature story and set up the timer for the next story.

Kenneth Brooks  Aug 13, 2009 
PDF
Page 148
toggleFeatureDrawer code

The toggleFeatureDrawer, showFeatureStory and readFeatureStory all refer to this.featureIndexFeed and featureIndexStory.

The user is never instructed to create them.



What should happen:

User should be instructed to add the following code to the bottom of the FeedListAssistant.prototype.setup.


this.featureIndexFeed = 0;
this.featureIndexStory = 0;

Note from the Author or Editor:
Chapter 5, Section "Back to the News: Adding a featured feed Scroller", page 140 (book). Replace:

Set up the Drawer and the Scroller in the feedList-assistant.js. Set up a listener for taps
to the new tap target in the header and then the Drawer widget with the state defined
by a new global, News.featureFeedEnable. In Chapter 6, we?ll add saved preferences
and we will retain the drawer?s state at that time.

With:

Set up the Drawer and the Scroller in the feedList-assistant.js. Set up a listener for taps
to the new tap target in the header and then the Drawer widget with the state defined
by a new global, News.featureFeedEnable. Initialize this.featureIndexFeed and featureIndexStory to zero in the setup method. These are used by the feature feed methods to reference the currently displayed story:

// Setup up feature story index to first story
this.featureIndexFeed = 0;
this.featureIndexStory = 0;

In Chapter 6, we?ll add saved preferences and we will retain the drawer?s state at that time.

Kenneth Brooks  Aug 13, 2009 
PDF
Page 127
Section 4.2.1.5

What I see:

The user is instructed to add a viewMenu, which in itself has the title of the feed.

When it is run, both the view menu and the feedTitle divs are shown, overlayed.


What should happen:
The user should be instructed to remove the existing Feed Title from the story list scene.

<div id="feedTitle" class="palm-header center">
Feed Title
</div>

Note from the Author or Editor:
Chapter 4, Section 'View menu', page 119 (book), add the following comment at the very end of the section, just before the sentence containing "Figure 4-8 shows the News application's storyList..." :

You'll need to remove the div with the id feedTitle from storyList-scene.html to avoid having the old HTML title collide with our new view menu title.

Kenneth Brooks  Aug 12, 2009 
PDF
Page 114
checkSuccess method

Since this is now in the app dialog, everything must use the sceneAssistant instead of using the controller directly.

This line does not work and breaks the app.
var addFeedTitleElement = this.controller.get("add-feed-title");

It should be replaced with this line:
var addFeedTitleElement = this.sceneAssistant.controller.get("add-feed-title");

Note from the Author or Editor:
Chapter 4, section 'Back to the News: Adding an Add Feed dialog', page 105 (book/pdf). Code is wrong on failure cases on AddDialogAssistant; use sceneAssistant's controller methods when getting the 'add-feed-title' element.

In both checkSuccess and checkFailure methods, replace:
var addFeedTitleElement = this.controller.get("add-feed-title");
with
var addFeedTitleElement = this.sceneAssistant.controller.get("add-feed-title");

Same lines of code should be changed in Appendix D, page 371 (book/pdf)

Kenneth Brooks  Aug 10, 2009 
PDF
Page 98
Bottom of the code sample

In the code being added to the feed list assistant it references closeAddFeedHandler and then doesn't give the code to implement that. The next page refers to it as checkIt and says that the code is available in the Appdendix. Neither of which is true. There is no implementation of closeAddFeedhandler or checkIt in the appendex.

Beyond that, the implementation in the appendix doesn't use a handler, it attempts to use this.widget.mojo.close.

At a minimum it shouldn't refer you to a non existent implementation and provide a basic one:

in the setup:
this.cancelButtonModel = {label: "Cancel", disabled: false};
this.controller.setupWidget("cancelButton", {type: Mojo.Widget.defaultButton}, this.cancelButtonModel);

this.closeDrawerHandler = this.closeDrawer.bindAsEventListener(this);
this.controller.listen("cancelButton", Mojo.Event.tap, this.closeDrawerHandler);

for the implementation:
FeedListAssistant.prototype.closeDrawer = function() {
this.addDrawerModel.open = false;
this.controller.modelChanged(this.addDrawerModel);
}

Note from the Author or Editor:
Chapter 3, Section "Adding Text Field to News", page 90 (book). The text refers to this.checkIt, but should be referring to this.checkFeed.

On the same page, add the following just after the paragraph containing the this.checkIt (this.checkFeed) references:

To handle the cancel button selection, you'll need a handler to close the drawer and clear the text fields:

// closeAddFeed - close Drawer
FeedListAssistant.prototype.closeAddFeed = function() {
// Close Drawer and clear text fields
this.addDrawerModel.open = false;
this.controller.modelChanged(this.addDrawerModel);

// Clear text fields for next time
this.nameModel.value = "";
this.controller.modelChanged(this.nameModel);
this.urlModel.value = "";
this.controller.modelChanged(this.urlModel);
};



Kenneth Brooks  Aug 10, 2009 
PDF
Page 99
Top

At the end of the sample code where you are telling the user to addItemLabel

addItemLabel: "Add...",

You also have the items in the widget model being set to feedList

this.feedWgtModel = {items: feedList});


According to all the previous code in the book this this is incorrect and should be using this.feeds.list

this.feedWgtModel = {items: this.feeds.list});

Note from the Author or Editor:
The last line of code on page 89 (Chapter 3, Text Fields), replace
this.feedWgtModel = {items: feedList});
with:
this.feedWgtModel = {items: this.feeds.list});

Kenneth Brooks  Aug 09, 2009 
PDF
Page 87
After the updateFeedList method

Page 87 shows updateFeedList that has a dependency on this.feedIndex.

this.feedIndex has never been initialized thus far.


What should happen.

Just following the updateFeedList code section it should be mentioned that initialize should be modified to set this.feedIndex = 0

initialize: function() {
this.feedIndex = 0;

this.list = this.getDefaultList();
},

Note from the Author or Editor:
Chapter 3, Section "Back to the News: Adding a feed list", page 75 (book).

After the code sample for updateFeedList, add the following comment:

The updateFeedList() method is dependent on a new property, this.feedIndex. You must initialize this to 0 in the feeds initialize method:

initialize: function() {
this.feedIndex = 0;
...
}

Kenneth Brooks  Aug 08, 2009 
PDF
Page 87
Middle of page, in updateFeedList code

What I see:

On page 87 of the v1final PDF the code shows an index being passed in.

updateFeedList: function(index) {

That index is never used.


What should happen:

The function should be updated to remove the index argument.

updateFeedList: function() {

Note from the Author or Editor:
Chapter 3, section "Back to the News: Adding a feed list', page 75 (book), and Appendix D, News/app/models/feeds.js, page 401. Remove unused argument in updateFeedList function definition.

Replace:
// updateFeedList(index) - called to cycle through feeds. This is called
// once per update cycle.
updateFeedList: function(index) {
News.feedListUpdateInProgress = true;

// request fresh copies of all stories
this.currentFeed = this.list[this.feedIndex];
this.updateFeedRequest(this.currentFeed);
},

With:
// updateFeedList() - called to cycle through feeds. This is called
// once per update cycle.
updateFeedList: function() {
News.feedListUpdateInProgress = true;

// request fresh copies of all stories
this.currentFeed = this.list[this.feedIndex];
this.updateFeedRequest(this.currentFeed);
},

Kenneth Brooks  Aug 08, 2009 
PDF
Page 114
1st Paragraph

Wrong:
Add this.widget.mojo.close() after successfully adding the feed in checkOk.


Reason: There is no checkOk method that is called, did you mean checkFeed?

Note from the Author or Editor:
Page 105, replace:
Add this.widget.close() after successfully adding the feed in checkOk.
with:
Add this.widget.close() after successfully adding the feed in checkSuccess.

Joseph Crawford  Aug 07, 2009 
6.2.1
loadFeedDbOpenOk function

There is no mention of simpleGet() as a function of the Depot, only get(). Which one is correct?

Note from the Author or Editor:
The simpleGet() and simpleAdd() are deprecated Depot methods, which appear in the sample code on pages 168, 397 and 401, and should be replaced with the get() and add() methods.

Specific changes are:

On pages 168 & 397, replace:
this.db.simpleGet("feedList", this.loadFeedDbGetSuccess.bind(this),
this.loadFeedDbUseDefault.bind(this));

with:
this.db.get("feedList", this.loadFeedDbGetSuccess.bind(this),
this.loadFeedDbUseDefault.bind(this));

On page 401, replace:
this.db.simpleAdd("feedList", this.list,
function() {Mojo.Log.info("FeedList saved OK");},
this.storeFeedDBFailure);

with:
this.db.add("feedList", this.list,
function() {Mojo.Log.info("FeedList saved OK");},
this.storeFeedDBFailure);


Marvin Fetalino  Aug 06, 2009 
PDF
Page 98
Code Sample

You never actually tell the reader that they need to add a snippet of code in the code listing you have.

You failed to include the following code:

this.listAddFeedHandler = this.addNewFeed.bindAsEventListener(this);
this.controller.listen("feedListWgt", Mojo.Event.listAdd, this.listAddFeedHandler);

Note from the Author or Editor:
The text directs the reader to create a listener but doesn't specifically show the code required for that listener. The statement:
"Add a listener for the Mojo.Event.listAdd event ..."

directs the reader to add code similar to this:

this.listAddFeedHandler = this.addNewFeed.bindAsEventListener(this);
this.controller.listen("feedListWgt", Mojo.Event.listAdd, this.listAddFeedHandler);

Joseph Crawford  Aug 03, 2009 
PDF
Page 98
Code Sample

In the code sample you call the following code

this.closeAddFeedHandler = this.closeAddFeed.bindAsEventListener(this);

However you never show the code for that event handler in the chapter.

Note from the Author or Editor:
The code for the closeAddFeed handler was not included in the text but is identical to the code for the addNewFeed handler except that you will set the this.addDrawerModel.open to false before calling this.controller.modelChanged(this.addDrawerModel).

Joseph Crawford  Aug 02, 2009 
PDF
Page 96
Last paragraph of Smart Text Features Area

Emoticons is another property, which will direct the STE to substitute bitmap
images in place of common emoticon text strings, such as &#9786; for :) among many
others.

When I copy/paste the text above the graphical smiley shows just fine, however in my PDF it shows as an ascii square. Looks like a 1:1 (box) with a black border.

Note from the Author or Editor:
The square box should be replaced by a smiley icon, commonly typed as :).

Joseph Crawford  Aug 02, 2009 
PDF
Page 89
3rd Paragraph

You state that the method will be called from within the
updateFeedSuccess(): method but never show where to put the call in that method.

Note from the Author or Editor:
On page 80, the text indicates that updateListModel() method should be called from within updateFeedSuccess(), but doesn't indicate exactly where those calls should be made. They should be made whenever the feedlist object is changed following an update feed. The exact location isn't critical as long as it's done following any change to the feedlist.

Joseph Crawford  Aug 02, 2009 
PDF
Page 88
1st Code Sample

You tell readers to change the scene that is being pushed from storyList to feedList, however you never tell them to remove the following line

this.feeds.updateFeedRequest( this.feeds.list[0] );

You cannot have that line in the code because later on when you do the AJAX stuff if this line is in place the scene starts up as a blank white card. Once you swipe to scroll or click then it shows the list. Once I removed that line all was working fine.

Note from the Author or Editor:
Replace:
Change the stage controller to push the feedList scene, and when you run the application now, you?ll see that it?s starting to take the basic structure of the envisioned application.

With:
Change the stage controller to push the feedList scene and remove:

this.feeds.updateFeedRequest( this.feeds.list[0] );

Now when you run the application, you?ll see that it?s starting to take the basic structure of the envisioned application.

Joseph Crawford  Aug 02, 2009 
PDF
Page 82
Whole Section

I am not sure but I have typed the code properly as the book stated but I cannot get the new feeds to come through. Do I have to go to Appendix D and get that global function and put it in place for it to work? This may confuse some users as it has me.

Note from the Author or Editor:
Although the processFeed() method is not detailed in the text, it is required to make this version of the application functional. You will need to incorporate it in your application using either the source in Appendix D or by downloading it from the source site.

Joseph Crawford  Aug 01, 2009 
PDF
Page 79
2nd paragraph

WRONG
Ajax requests are a common way of referring to use of the XMLHttpRequest

CORRECT
Ajax requests are a common way of referring to THE use of the XMLHttpRequest

Note from the Author or Editor:
Typo. On page 69, replace

Ajax requests are a common way of referring to use of the XMLHttpRequest

with

Ajax requests are a common way of referring to the use of the XMLHttpRequest

Joseph Crawford  Aug 01, 2009 
PDF
Page 79
Figure 3-7

In the chapter prior to this Figure you never tell us to put the CSS in place for the storyRowTemplate. You are calling the class news-subtitle on the last line of page 75. Without the style in place the outcome does not look like your image in Figure 3-7.

Note from the Author or Editor:
On page 69, at the end of the 'Back to the News: Adding a Story List' section, just before the next section, add the following:

To get the proper styling for the list entry, you'll need to add some styling to your CSS for the news-subtitle selector:

.news-subtitle {
padding: 0px 14px 10px 14px;
font-size: 14px;
margin-top: -12px;
line-height: 16px;
}

Joseph Crawford  Aug 01, 2009 
PDF
Page 55
1st paragraph

I noticed that on this page you are telling users to create the /app/models/feeds.js file with the array of data to be used by the application.

however you never tell the user that they need to add it to the sources.json so when you put the application on the emulator/device it does not know where to find the feeds.

This should be fixed before the book is printed as it is going to confuse a LOT of people who are just starting out.

Note from the Author or Editor:
In section 2.2.7, just before paragraph that begins "Feeds includes a single feed entry for the New York Times RSS feed and four stories.", add the following:

Don't forget to add feeds.js to your sources.json:

[
{
"source": "app/assistants/stage-assistant.js"
},
{
"source": "app/assistants/storyView-assistant.js",
"scenes": "storyView"
},
{
"source": "app/models/feeds.js"
}
]

Joseph Crawford  Aug 01, 2009 
PDF
Page 45
Section 2.2.4.1

I noticed that in the palm-generate command you are still doing storyView as the scene name. Also in figure 2.3 you show a screen shot of the directory views/storyView/

The issue is that when you execute that command the generation tools generate the directory as story-view and NOT storyView.

This will probably confuse some people and should have been updated before the book went to production.

Note from the Author or Editor:
In early versions of the SDK, the palm-generate tool formatted camel case scene names differently than is shown in the book. This was corrected in SDK-19 (posted on August 14, 2009). If you are seeing the problem described by the reader, then you are most likely using an out of date version of the SDK. Download the current SDK at http://developer.palm.com/ and when you run the examples, the scene names will be formatted as described in the book.

For Windows users, if you have installed SDK-19 but are still seeing the problem, then you may have to uninstall the SDK and reinstall it. There is known problem with upgrading the SDK on Windows.

Joseph Crawford  Aug 01, 2009