Opened 9 years ago
Closed 8 years ago
#15381 closed defect (fixed)
_WidgetBase tutorial error about event handling
Reported by: | bill | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.8 |
Component: | Documentation | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
From the mailing list, http://dojotoolkit.org/documentation/tutorials/1.7/understanding_widgetbase/ has some errors. It says:
btn.on(foo, "bar", function(){ // note that "bar" is executed in the scope of btn! this.set("something", somethingFromFoo); });
but should be
btn.on("event", function(){ ... });
I'm not sure what you were trying to get at with "foo" or "bar" in the original example.
Also, subscribe() is mentioned in your tutorial although there's no example. It shouldn't be mentioned at all since it's a protected method.
Change History (4)
comment:1 Changed 9 years ago by
Owner: | set to Tom Trenka |
---|---|
Status: | new → assigned |
comment:2 Changed 9 years ago by
Owner: | changed from Tom Trenka to Brian Arnold |
---|
comment:3 Changed 8 years ago by
Milestone: | tbd → 1.8 |
---|---|
Owner: | changed from Brian Arnold to bill |
I will fix. Note that the code was wrong initially, misunderstanding what connect() and subscribe() were for, and got further confused when the connect() description was converted to on().
comment:4 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Updated tutorial to just explain connect() and subscribe(). For the 1.8 tutorial, can explain both on(), and this.own().
I didn't write that; it must have been an alteration with the updates from 1.6 to 1.7 tutorials, and I have no idea who made those updates. Reassigning to brianarn for direction.