Thx for your patch Sebastian, but it's still not working. e.getData() gives me qx.ui.menu.MenuButton back and not an image i was clicking at. One of the possible reasons for this can be the fact that i'm still using revision 4659 - but i haven't seen any other changes in "Command interface" comparing to the head revision.

The only place where i can see what image i've clicked at is in the contextmenu-eventlistener function:

=======================**snip**=======================
.
.
.
image.setContextMenu(cmenu);
image.addEventListener('contextmenu', function(e){
this.debug("Target is: "+e.getTarget()); //gives me the right object back
   image.getContextMenu().show();            //show the menu
}, image);
=======================**snap**=======================
but not in the command. Is there any "elegant" way to provide this information to the command?

Your help is really appreciated,

alex.d
You can simply use the target. e.g.

this.info("What image: " + e.getData());

But I just found that the target is not set upped correctly. Please try the attached patch and report if it helped.

Modified in SVN with revision #5486.

Greetings,

Sebastian



Alex D. schrieb:
Hi folks,

i have a problem here an would like to know if anybody has any hints for me: In my app i have a layout with some images in it. Each image has a context menu like:
=======================*snip*=======================
var com = new qx.client.Command;
com.addEventListener("execute", function(e){
   this.info("What image???");
}, this);

var cmenu = new qx.ui.menu.Menu;
var m_1 = new qx.ui.menu.MenuButton("test", null, com);

cmenu .add(m_1);
cmenu .addToDocument();

image.setContextMenu(cmenu);
=======================*snap*=======================
And it works perfectly but i have to know in my command-function what image have user clicked at. Is there any way to do this? Any help is really appreciated.

Best Regards,
alex.d


------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


------------------------------------------------------------------------

_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------

Index: framework/source/class/qx/event/handler/EventHandler.js
===================================================================
--- framework/source/class/qx/event/handler/EventHandler.js     (Revision 5482)
+++ framework/source/class/qx/event/handler/EventHandler.js     (Arbeitskopie)
@@ -178,7 +178,7 @@
     {
       // allow the user to stop the event
       // through the execute event.
-      if (!vCommand.execute()) {
+      if (!vCommand.execute(e.getTarget())) {
         e.preventDefault();
       }
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to