cancel
Showing results for 
Search instead for 
Did you mean: 

How to use single eventhandler for all menuitems...

former_member495024
Discoverer
0 Kudos

Hi all,

I have a tray with a popup.

Currently I have an eventhandler for every single menuitem.

Is it also possible to provide only a single eventhandler for all of the menuitems and determine the clicked entry with the event??

Tried to use parameter mapping but onAction doesn't provide any parameters... Or am i wrong?!

Additionally, is there a list populated where I can find provided parameters for mapping?!

Thanks in advance for replies.

Bastian

Message was edited by: Bastian Schnorbus

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Bastian,

This is possible via parameter mapping.

1. Set same action for every menu item;

2. Add parameter, say "id" of type string to action;

3. In wdDoModifyView write the following:


if (firstTime)
{
  IWDMenuActionItem itm;
  itm = (IWDMenuActionItem)view.getElementById("<id-of-menu-item>");
  itm.mappingOfOnAction.addParameter( "id", itm.getId() );
  /* repeat for all items */ 
}

4. In view handler you now can dispatch by "id" parameter received;

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com