Hi Maria Jose,

hope others could give us how they see it. Maybe a clue on how this works
on Flex could help here, could you take a look?
I think what you are suggesting is ok, since if we have already selected
the item, there's no "change" really.
But maybe the concept could be "let always notify a 'change' event and
leave to the user the responsibility to check if the item is the same".
I bet for the first since for the other we already have the "itemClicked"
event, and I think other components with CHANGE event, like CheckBox, works
that way.

So hope others can guide us on the best generalistic approach

Thanks! :)



El lun, 30 nov 2020 a las 14:41, Maria Jose Esteve (<[email protected]>)
escribió:

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

-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Reply via email to