on 09-20-2007 4:56 AM
Hi all,
I've a action that was fired by two buttons, how to identify what button that call the action?
public void onActionTest(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionTest(ServerEvent)
???
//@@end
}
Regards
Hi
Try to pass different parameter through different buttons,
may be True from one
False fro second
then based on that you can find which button is pressed
try the link for knowing more how to pass parameter through onAction
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/60/1f1f056f057d4d962375efd3c92ed0/frameset.htm">onAction Parameter</a>
Regards
Abhijith YS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Write this code in the "<i>wdDoModifyView()</i>" method:
//let's say the first button ID is btn1
IWDButton buttonOne = (IWDButton) view.getElement("btn1");
buttonOne.mappingOfOnAction().addParameter("commandID","btn1");
//let's say the second button ID is btn2
IWDButton buttonTwo = (IWDButton) view.getElement("btn2");
buttonTwo.mappingOfOnAction().addParameter("commandID","btn2");
Edit "<i>onActionTest</i>" event handler to add a new parameter to it. Call the new parameter "<i>commandID</i>" and it should be of type "<i>String</i>". Now this will look like:
public void onActionTest(IWDCustomEvent wdEvent, String commandID){
//here <b>commandID</b> contains the ID of the button which was clicked
}
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Most probably it won't be possible to determine this. You need to have a seperate action on button2 and button1.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
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.