Wayne Si schrieb:
> 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?
>
>   
What we do, e.g. in the tree, is walking up the widget tree until we 
find the widget we are interested in:

var list = e.getTarget();
while (list && !(list instanceof qx.ui.form.List)) {
    list = list.getLayoutParent();
}

This code works no matter how the child widgets are organized. We use 
this kind of code in some places.


Best Fabian

-- 
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG
Brauerstraße 48
76135 Karlsruhe

Amtsgericht Montabaur HRB 6484

Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas 
Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss, Achim 
Weiss
Aufsichtsratsvorsitzender: Michael Scheeren


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

Reply via email to