cancel
Showing results for 
Search instead for 
Did you mean: 

Radio button in a Table -Only one row/radio button selection to be possible

Former Member
0 Kudos

Hi experts,

I have a requirement from customer to have a radio button inside a table of a WebDynpro ABAP application. For example, a table containing list of mobile numbers.

The columns has

Mobile Model, Cost, Company name, and a radio button named choice.

Only one record and hence one radio button can be chosen at a given time.

When the user clicks on the radio button choice corresponding to the row of the mobile of his choice, the row should get lead selected .

When the user chooses a different choice radio button (corresponding to another mobile) the old radio button choice should get deselected, new row and its radio button should be lead selected.

Can you give me the code how to deselect the remaining radio buttons when a user selects on one Radio button

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sandeep ,

Have a look at the events of table UI element and its paramaters , Here's the link.

[Link|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2d/390e422dfcde2ce10000000a1550b0/content.htm]

The event 'Onselect' or 'OnLeadSelect' provides 4 standard paramaters , out of which , OLD_LEAD_SELECTION/OLD_ROW_ELEMENT is one of them.

So you could use this element and set the attribute value (Which is bound to the radio button) to abap_false.

Although I am not sure as to which event ight trigger ( ON_LEAD_SELECT / ON_SELECT ).:)

Thanks,

Aditya.

Former Member
0 Kudos

Hi,

Can you provide a code sample of how to use OLD_LEAD_SELECTION/OLD_ROW_ELEMENT ?

Thanks for your help.

Regards,

Former Member
0 Kudos

Hi ,

Check the attribute that is bound to the setselected property , you should clear that attribute .

OLD_LEAD_SELECTION / OLD_ROW_ELEMENT provides the previously seleced element.

so just set the attribute of the element to abap_false.

OLD_LEAD_SELECTION->set_attribute( NAME = 'NAME_OF_ATTRIBUTE_BOUND_TO_SET_SELECTED'

VALUE = abap_false).

This should work out.

Thanks,

Aditya.

Answers (0)