cancel
Showing results for 
Search instead for 
Did you mean: 

wdDoModifyView

Former Member
0 Kudos

Hi,

I have 4 buttons on my view, and am trying to get the id of the button clicked in the wdDoModifyView(). Based on the click I intend to change values.

Is this possible.

NAC

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hello SAP Partner,

[skipped]

...

[/skipped]

Best regards, Maksim Rashchynski.

Use approach mentioned be Armin and Santhosh.

Message was edited by: Maksim Rashchynski

Former Member
0 Kudos

The correct way uses parameter mapping as shown by Santhosh Chandran.

Armin

Message was edited by: Armin Reichert

former_member182372
Active Contributor
0 Kudos

Hello Armin,

Question was - how to get ID not in action handler but in wdDoModifyView method.

And BTW I put the warning below the message about this "solution".

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

OK, then the answer is: transfer the ID into the action handler using event parameter mapping, store it in a view context attribute and get it from this attribute in wdDoModifyView().

But I doubt that the original poster really wants to do these changes in wdDoModifyView().

We should not propagate using non-API methods in this forum.

Armin

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

1. create an action with string (id of the button) as argument.

2. In the action handler, based on id of the button you can change the values you want to change.

3. In the "wdDoInit()", write the following code

if(firsttime){
   IWDButton button1 = (IWDButton)view.getElement("<<Button id1>>");
   button1.mappingOfAction().addParameter("id",button1.getID());
   IWDButton button2 = (IWDButton)view.getElement("<<Button id2>>");
   button2.mappingOfAction().addParameter("id",button2.getID());
}

4. When the button is clicked, you will be able to get the "id" of the button in the action handler. Based on the id change the value. (The values you want to change modify it thr context attributes).

Regards,

Santhosh.C

Former Member
0 Kudos

Any thoughts on this.

~NAC