Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Radio button/s with out default selection?

former_member194142
Participant
0 Kudos

Hello

I have placed 3 radio buttons set/group on my selection screen, say, rb1 rb2 and rb3.

As we knew by default the rb1 will be selected.

But, I don't want to have a default selection, hence all the 3 RBs should be open (not selected) so that user will be forced to select one rb.

Because I need to write a routine the moment user picks a RB

Pls. let me know how can I make RBs with out default selection?

Thank you

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor

Hi,

Atleast one radio button in the group needs to be selected. Even if you try to hide the radio button which you select by default, the next radio button will be selected. So I don't think it is possible. Either you should go with checkbox as suggested. But disadvantage in that, user can select more than one box. If you want to restrict that, you may need to put a condition to overcome that Not more than one checkbox selection is allowed.

6 REPLIES 6

gurunathkumar_dadamu
Active Contributor
0 Kudos

Hi SAP,

This feature is not possible in case of radio buttons.This is will possible in case of check. os better to go with check box option.

Regards,

Gurunath D

former_member194739
Active Participant
0 Kudos

Hi,

It is not possible. It is possible in webdynpro ABAP. It's mandatory to specify a default. Through check box, we disable and enable the radio buttons.

Regards,

Abbas.

jayanthi_jayaraman
Active Contributor

Hi,

Atleast one radio button in the group needs to be selected. Even if you try to hide the radio button which you select by default, the next radio button will be selected. So I don't think it is possible. Either you should go with checkbox as suggested. But disadvantage in that, user can select more than one box. If you want to restrict that, you may need to put a condition to overcome that Not more than one checkbox selection is allowed.

rajkumarnarasimman
Active Contributor
0 Kudos

Dear Sap,

No-Default addition is not possible in Radio button concept. It requires one option to be selected for every radio button group. It is better to use Checkbox for your requirement. The same type of validation can be done in Checkbox too. Try the same.

Thank you

Rajkumar

Former Member
0 Kudos

If your only intention is to execute a routine when a radio button is selected, you can just run the routine once during initialization. Since by default first RB is set, your routine will execute as though user has selected RB1.

tridwip
Participant
0 Kudos

Yes It is possible.. Please look at the below example of code..write it in onInit() function:

this.getView().byId("radioButtonGroupID").setSelectedButton(null);

Hope it helps!