on 10-14-2009 7:16 AM
Hi,
In my WebDynpro application I have a Button, and on click of the button, I have a capture the button ID. Please suggest me how to do that.
Regards,
Umapathi
Hi
Simply you can achieve this by [parameter mapping|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/0038f00f-9dfe-2b10-69a4-f1ce24d55d59&overridelayout=true]
BR
Satish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
I want to Capture the ID of Button on which I click.
Here is a senario...
I have Button (with the button UI id is "button_id") and an action GO and an evnt handler
onActionGO(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent) {
// here i am going to call one method which takes the string argument and i have to pass the button id
callMethod(button_id)
}
so tell me now...how to get the button id on click of my button GO.
Hi,
I have two buttons in my application (for example button_id1 and button_id2) which call the same event handler (as metined above onActionGO)
And in the callMethod() i am passing the button id as a argument...
if(button_id1) then display the popup window on top of the page...else
if (button_id2) then display the popup window on bottom of the page...
onActionGO(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent) {
callMethod(button_id);
}
callMethod(String buttonID) {
// I have a logic to open the popup that is to open the window
if(buttonID == "button_id1")
window.setWindowPostions(WDWindowPos.TOP);
} else {
window.setWindowPostions(WDWindowPos.BOTTOM);
}
In the onActionGo write following code.
String button_Id = wdEvent.getString("buttonId");
I hope it helps.
Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I assume you have associated one Action to more than one buttons, and in the action event handler you want to determine the Button which has triggered the event.
This can be achieved through parameter mapping. In wdDoModify method add the following piece of code.
if(firstTime) {
IWDButton button1 = (IWDButton)view.getElement("<button1_id>");
IWDButton button2 = (IWDButton)view.getElement("<button2_id>");
button1.mappingOfOnAction().addParameter("button_id","<button1_id>");
button2.mappingOfOnAction().addParameter("button_id","<button2_id>");
}
In the action event handler, you can determine the id of the button as under.
String buttonId = wdEvent.getString("button_id");
Regards
kk..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you please explain what is your requirement???
If you want to capture the button Id value on action of some other UI Element, what you can do is
Create a context attribute of type String and assign this variable to the ID property of the required Button.
Now in DoInIt() method, set this button ID context variable. Now you can access this button where ever you want by using
wdcontext.yourContextElement().getVa_ButtonID()... where Va_ButtonID is the context attribute you created and mapped to the ID Property of the button.
Regards,
SrinivaS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
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.