on 02-09-2011 4:59 PM
Hi Experts,
I've a doubt.
I want to create a view with many buttons, but instead of creating an action for every button I want to create only one action that depending on which one is clicked triggers a logic or another. I understand that I have to create an action with one parameter that represents my button (IWDButton, I guess), but I don't know how to inform the action which button was pushed. I read this article: [http://help.sap.com/saphelp_dm40/helpdata/en/60/1f1f056f057d4d962375efd3c92ed0/content.htm] but I'm lost.
All my buttons has a parameter named "clickedButton", type: IWDButton
Is it possible or I'm wrong?
Thanks in advance,
Joan
hi
you can achieve this by adding the parameter and giving its value different for different buttons
write the following code in wddomodifyview method.
if(firstTime) {
IWDButton btn1 = (IWDButton)view.getElement("<btn1_id>");
IWDButton btn2 = (IWDButton)view.getElement("<btn2_id>");
btn1.mappingOfOnAction().addParameter("id","1");
btn2.mappingOfOnAction().addParameter("id","2");
}
then in the eventhandler
write
String Id = wdEvent.getString("id");
now if id is 1 it is coming form first button and 2 means from the second button.
thanks
sarbjeet singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.