on 07-03-2007 6:00 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.