cancel
Showing results for 
Search instead for 
Did you mean: 

button id

Former Member
0 Kudos

hai to all,

how to get the corresponding id of a UI element button when clicked.

Thanks...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Ram,

Just create one importing parameter in method

ID Type String.

And check value of ID in method it will return you button ID (Which Button is clicked)

It will work fine, I have done the same.

Regards,

Varun

Former Member
0 Kudos

Creat a context-element and fill it with the ID while performing the action (in the action method). So, you always have the value at hand.

Regards

Torsten

Edited by: Torsten Nordmann on May 2, 2008 1:18 PM

Answers (3)

Answers (3)

Former Member
0 Kudos

hai,

Actually i need that id in wddomodifymethod not in that corresponding event handler method....as u said ,using wdevent parameter is possible only in event handler method....can u help me...

there is a method get_id in cl_wd_button...

data: id_button type string,

lr_button TYPE REF TO cl_wd_button.

id_button = lr_button->if_wd_view_element~get_id( ).

but tis throws 'access through null object reference not possible'..

any idea??

Former Member
0 Kudos

Hi Ram,

Just create one import parameter at your event handler method as name as ID. it will automatically receives the ID of the button.

Then append this ID value into one local variable.

Then using set attribute method set this value to one attribute.

So after clicking the button, That attribute automatically stores your button ID.

So at domodify view you can get the Button ID using the Get attribute statement.

Thanks.

Former Member
0 Kudos

Well, not directly, but the name ist encapsulated in the wdevent parameter, which ist given in the action method.

And its indeed called 'ID' . So, you should be able to retrieve it via:

WDEVENT->get_data( 'ID' ).

Regards

Torsten

Former Member
0 Kudos

hi chinna.......

on the on action method, you will automatically have the id as the importing parameter.

---regards,

alex b justin