e.getTarget() returns different values

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

e.getTarget() returns different values

johnd
I have a TreeFile that has a listener for activate

When I activate the TreeFile  by clicking on differnt parts of it (the
picture, the text, or the blank area
next to it) I get get different results from e.getTarget();

like label, image, or treefile

when I call e.getTarget in the drop handler it always get the label


it makes it hard to know what the users clicks if I can't get a label,
or at least something consistent


is this supposed to be this way?


here is some of my code:



 for(i = 1; i<=count; i++){
            cam  = new
qx.ui.tree.TreeFile(jData.VideoEncoder.Stream[i].name);
            cam.setDraggable(true);
            cam.addListener("dragstart",
                function(e)
                {
                    e.addAction("copy");
                });
            cam.addListener("activate",
                function(e)
                {
                    pane.remove(boxTabview);
                    pane.remove(camTabview);
                    pane.add(camTabview);
                    this.debug('from: '+e.getTarget());  // this returns
different things
                });
            box.add(cam);
        }


-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: e.getTarget() returns different values

Fabian Jakobs
Administrator
hi John,

> I have a TreeFile that has a listener for activate
>
> When I activate the TreeFile  by clicking on differnt parts of it (the
> picture, the text, or the blank area
> next to it) I get get different results from e.getTarget();
>
> like label, image, or treefile
>
> when I call e.getTarget in the drop handler it always get the label
>
>
> it makes it hard to know what the users clicks if I can't get a label,
> or at least something consistent
>
>
> is this supposed to be this way?
>  
Yes this is intended. In a tree item the widget, which has been clicked
is always the one, which is activated. This can be the icon, the label
or any other child widget of the tree item. Activating a widget causes
the event handler to use this widget as target for key events.

The reason we activate the clicked widget is that the tree item might
e.g. contain a checkbox. If the checkbox is not activated it will not
receive any key events. You can get the tree item from any child of a
tree item by using the method "getTreeItem" defined in the tree class.


Best Fabian



>
> here is some of my code:
>
>
>
>  for(i = 1; i<=count; i++){
>             cam  = new
> qx.ui.tree.TreeFile(jData.VideoEncoder.Stream[i].name);
>             cam.setDraggable(true);
>             cam.addListener("dragstart",
>                 function(e)
>                 {
>                     e.addAction("copy");
>                 });
>             cam.addListener("activate",
>                 function(e)
>                 {
>                     pane.remove(boxTabview);
>                     pane.remove(camTabview);
>                     pane.add(camTabview);
>                     this.debug('from: '+e.getTarget());  // this returns
> different things
>                 });
>             box.add(cam);
>         }
>
>
> -------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>  


--
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel