PDA

View Full Version : context menu supported in dhtml v4.1?


mico
07-07-2008, 11:25 PM
no custom-context menu displayed in dhtml v4.1
even not for the case shown in http://www.openlaszlo.org/lps4.1/docs/developers/input-devices.html

any idea ? dear experts...

<canvas>
<simplelayout spacing="3"/>
<view width="350" height="100" bgcolor="#cccccc">

<text text="For my context menu to work, I need to run in SWF8"/>

<method event="oninit">
var cmenu = new LzContextMenu(); // create the menu
var item1 = cmenu.makeMenuItem('hello', new LzDelegate(this, null)); // create the menu item,

and set up an LzDelegate as a callback
cmenu.addItem(item1); //add the item to the menu
this.setContextMenu(cmenu);
</method>
</view>
</canvas>

senshi
07-08-2008, 03:57 PM
A little braino, filed at LPP-6632 (http://www.openlaszlo.org/jira/browse/LPP-6632).

mico
07-08-2008, 11:22 PM
A little braino, filed at LPP-6632 (http://www.openlaszlo.org/jira/browse/LPP-6632).

thanks senshi
the patch in it do work

btw:delegates could be bind to ContextMenuItems via constructor or setter
ContextMenu.makeMenuItem("text", new LzDelegate(target, "doSomeThing"));
and the method
<method name="doSomeThing" args="arg">

the class of arg used to be ContextMenuItem in 4.0.12 and 4.1 beta
but
it became a wrapper class with attribute "owner" whose value is inface the very ContextMenuItem
the API is changed , causing mismatching errors

so is it another bug of ContextMenuItem ? or i missed reading some important descriptions?anyone who meet with the same error?

mico
07-13-2008, 06:02 PM
not anybody who found this feature?

senshi
07-14-2008, 11:49 AM
not anybody who found this feature?
This seems to be one of these "features" which should go to the bug feature tracking system (http://www.openlaszlo.org/jira/secure/Dashboard.jspa).
(btw, swf works correctly, it's only dhtml which is broken...)