on 05-11-2006 6:21 PM
Hello,
Does anybody know how to find out which element on the screen triggered the action? Within action method I need to know which element triggered the action.
Elements are created dynamically and action to them is bound during run time.
Thank you.
Example: You have 2 buttons "B1", "B2" and both are assigned the same action. How to know in the action handler which button was pressed?
Solutions: Event parameter mapping
B1.mappingOfOnAction().addParameter("Button", "B1");
B2.mappingOfOnAction().addParameter("Button", "B2");
Declare an action parameter "Button" of type String. Then at runtime, this parameter will contain "B1" or "B2" depending on the button that was pressed.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Amin,
I am very clear on wdDoModiryView is here for.
I thougth that at the time of creation of a button I assign an id to it. For example MyId="5234523452345"
Than, in action handler I add a parameter with the same name as I created - MyId of type int. So when the action is called I get reference to ID of an element that triggered that action, correct?
If so what is wdDoModifyView is for?
Could you please comment?
Thank you
I don't understand the question "If so what is wdDoModifyView is for?".
In WD Java, this method is the only place where you can create and access view elements, I assume this is similar in WD ABAP.
So if you want to create buttons programmatically or get a reference to an existing button and define an event parameter mapping (as in my example), this must be done inside method wdDoModifyView().
Armin
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
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.