Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#6492 closed defect (fixed)

StackController: changed buttonWidget setChecked API behavior from 1.0 to 1.1

Reported by: James Burke Owned by:
Priority: high Milestone: 1.1
Component: Dijit Version: 1.1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

In the StackContainer.js, in the definition for StackController.onSelectChild:

In Dojo 1.0, it would call oldButton and newButton's setChecked method. This allowed those buttons to do different styling based on the checked state.

In Dojo 1.1, oldButton and newButton's setChecked method is not called, but instead uses a setAttribute call on the buttons.

I can appreciate that the setChecked method on dijit.form.ToggleButton is deprecated, but this feels like API breakage since someone who overrides the StackController's buttonWidget string and uses their own button that expects onChecked to be called on their button, it does not work if they move to 1.1.

Not sure if it is a high enough priority to warrant a fix or if you want to treat this as a release notes thing, but just mentioning it since I just spent some time tracking this down in some Dojo 1.0 code that I am porting to 1.1.

Change History (2)

comment:1 Changed 14 years ago by bill

Description: modified (diff)
Resolution: fixed
Status: newclosed
Summary: StackController.js changed buttonWidget setChecked API behavior from 1.0 to 1.1StackController: changed buttonWidget setChecked API behavior from 1.0 to 1.1

Hmm, yeah, backwards compatibility on callbacks like this is tough. The idea of course is that Button.setAttribute() has special code for when checked/unchecked is set (basically a switch statement), so we aren't losing any functionality. At some point we need to call setAttribute() since setChecked is going away in 2.0, and even now calling it is bad since it will cause a deprecation warning.

I just updated the release notes to explain this, so I'm going to close this.

comment:2 Changed 14 years ago by bill

Milestone: 1.1
Note: See TracTickets for help on using tickets.