-
Notifications
You must be signed in to change notification settings - Fork 115
Closed
Description
Currently you can't change DateChooser controller class in MXML but assuming you could and did this then the Mouse controller gets replaced buy the keyboard controller. This seems to be by design - is this correct?
<js:DateChooser id="chooser" width="300" click="displayDate()">
<js:beads>
<js:DateChooserKeyboardController />
</js:beads>
</js:DateChooser>
So to fix it you add both controllers.
<js:DateChooser id="chooser" width="300" click="displayDate()">
<js:beads>
<js:DateChooserMouseController />
<js:DateChooserKeyboardController />
</js:beads>
</js:DateChooser>
This will die with a RTE in in DateChooserMouseController set strand method as getBeadByType fails to find the view (it's not in the list of beads yet) and returns null.
var view:DateChooserView = value.getBeadByType(IBeadView) as DateChooserView;
view.prevMonthButton.addEventListener("click", prevMonthClickHandler);
view.nextMonthButton.addEventListener("click", nextMonthClickHandler);
Perhaps the view could be obtained from value.view which does have the correct value?
This fixes it but seem rather verbose:
<js:DateChooser id="chooser" width="300" click="displayDate()">
<js:view>
<beads:DateChooserView />
</js:view>
<js:beads>
<js:DateChooserMouseController />
<js:DateChooserKeyboardController />
</js:beads>
</js:DateChooser>
Is it more correct / in line with PAYG to fix the issue in the DateChooserMouseController set strand method? Or should the default view be added to the beads before the set strand method is called?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels