cancel
Showing results for 
Search instead for 
Did you mean: 

Determine which component fired an action

Former Member
0 Kudos

I don't see anywhere where I can determine from an IWDCustomEvent which component fired the event.

I was hoping to setup a help system and wanted one single method to handle all the help events. It was my hope to determine which component fired the event that called the method and use that to determine which text to display.

Any help would be appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can use event parameter mapping for this. Example: You have 2 buttons "Button1", "Button2" and assign the same action to their "onAction" event.

Now you can add a parameter "button" to the action, and use parameter mapping code (or declaratively, if available in your IDE).

wdDoModifyView(...)
{
  if (firstTime)
  {
    IWDButton button1 = (IWDButton) view.getElement("Button1");
    button1.mappingOfOnAction().addParameter("button", button1.getId());
    IWDButton button2 = (IWDButton) view.getElement("Button2");
    button2.mappingOfOnAction().addParameter("button", button2.getId());
  }
}

Then action handler parameter "button" will contain the ID of the button that triggered the action.

Armin

Former Member
0 Kudos

Perfect! Thank yo uvery much!

Former Member
0 Kudos

This and many other useful things are also contained in Chris Whealy's book "Inside Web Dynpro for Java".

Armin

Answers (0)