Ticket #6492 (closed defect: fixed)

Opened 8 months ago

Last modified 4 months ago

StackController: changed buttonWidget setChecked API behavior from 1.0 to 1.1

Reported by: jburke Owned by:
Priority: normal Milestone: 1.1
Component: Dijit Version: 1.1.0
Severity: normal Keywords:
Cc:

Description (last modified by bill) (diff)

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

Changed 8 months ago by bill

  • status changed from new to closed
  • resolution set to fixed
  • description modified (diff)
  • summary changed from StackController.js changed buttonWidget setChecked API behavior from 1.0 to 1.1 to StackController: 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.

Changed 4 months ago by bill

  • milestone set to 1.1
Note: See TracTickets for help on using tickets.