I sent the unfinished mail, ...
Hi,
I wanted to expose a recurring behavior with the controls that implement
ISelectionModel (List, TabBar, ...) Whenever the control is "clicked" the
"change" event is dispatched, whether or not the index has changed.
I don't know if this behavior obeys a philosophy (launch the change because
there really is an event, even if it is selected) or because it has not been
considered.
If it did not obey a philosophy, we could modify the selectedHandler function
of the Model and verify the change before launching the change, or something
similar ...
In my case, for a List, I extended the ListSingleSelectionMouseController bead
as follows (I've included Carlos's latest changes):
override protected function selectedHandler(event:ItemClickedEvent):void
{
if(listModel.selectedIndex != event.index || listModel.selectedItem
!= event.data){
(listModel as IJewelSelectionModel).isItemClicked = true;
listModel.selectedIndex = event.index;
listModel.selectedItem = event.data;
sendEvent(listView.host, "change");
(listModel as IJewelSelectionModel).isItemClicked = false;
}
}
How do you see it?
Thx.
Hiedra