Hi Wayne,
Wayne Si wrote:
> Thanks Alex and Matt.
>
> Alex, I've tried your solution. In my event handler, I wrote
>
> var oList = e.getTarget().getLayoutParent();
>
> When the list is empty, I double clicked it and I saw oList is exactly the
> list I clicked on. That means I can do oList.getSelectedItem() immediately
> without using userdata.
>
> However, if the list is NOT empty and I double clicked on a list item, oList
> is no longer the list, instead it is a qx.ui.container.Composite.
>
> I may understand why I got different results, but I think it's some kind
> inconsistency and brings problem to development.
>
> Since I added a listener to the list control, then why can't I get another
> argument i.e. sender (the list in this case, not a part inside the list)
> besides the event in the event handler?
There is an easier approach to determine the current selection. You can
use the "changeValue" or "changeSelection" event of each list widget to
get the current selection.
--snip--
myList.addListener("changeValue", function(e) {
this.debug("Value: " + e.getData());
});
--snip--
You are talking about double clicking on a listitem. Do you have to rely
on double clicks or is it acceptable for you to use a single click?
Because the "changeValue" and "changeSelection" events are working with
single clicks.
cheers,
Alex
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel