Opened 7 years ago

Closed 7 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:


From the mailing list, 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 7 years ago by bill

Owner: set to Tom Trenka
Status: newassigned

comment:2 Changed 7 years ago by Tom Trenka

Owner: changed from Tom Trenka to Brian Arnold

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.

comment:3 Changed 7 years ago by bill

Milestone: tbd1.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 7 years ago by bill

Resolution: fixed
Status: assignedclosed

Updated tutorial to just explain connect() and subscribe(). For the 1.8 tutorial, can explain both on(), and this.own().

Note: See TracTickets for help on using tickets.