on 08-13-2008 1:49 PM
Hi all,
I want to create ContextMenu dynamically as I donot know the number of menu's i will need at design time. I was looking at the WD API but was unable to find a way.
I donot want to add menu items dynamically.
First of all, Is it possible do it? and if yes then how?
Thanks & Regards,
Gaurav
hi Armin,
I am using the 711 Netweaver. I am talking about the real context menus only. The context menu's which come on the rightclick event of mouse.
Thanks
Edited by: Gaurav Agrawal on Aug 13, 2008 3:44 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok.
In the view controller, there exists a hook method named "wdOnContextMenu". In this method, you can modify context menus.
Example: You create a context menu "MyContextMenu" in the IDE and assign it to a view element X by setting the (advanced) properties:
contextMenuId = "MyContextMenu"
contextMenuBehaviour = "provide"
Then at runtime when right-clicking on X (or its children) the hook method is called.
The parameter "event" will contain information on the click-position (the view element where the click occured, the view element that defined the context menu, the node element e.g. representing a table row).
The parameter "contextMenuManager" allows to create / modify / reassign the context menu.
Example: Change the text of the first menu entry to the ID of the clicked element:
IWDMenuActionItem item = (IWDMenuActionItem) contextMenuManager.getCurrentContextMenu().getItem(0);
item.setText( event.getOriginator().getId() );
Armin
Hi Gaurav Agrawal
,
Check the following link for creating dynamic UI elements with code,
http://help.sap.com/saphelp_nw70/helpdata/en/89/73a840bd6d3c13e10000000a155106/frameset.htm
following is one exercise,
Dynamically Creating the Form
Sample Apllications
thanks
Suresh
Edited by: Armin Reichert on Aug 13, 2008 3:14 PM
STOP ASKING FOR POINTS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you talking about the real context menus introduced in NW 7.1 or the old-style menus?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.