cancel
Showing results for 
Search instead for 
Did you mean: 

Radio Button

Former Member
0 Kudos

Hi All,

I need to have two radio button in a row.

I have done that but i want to have space inserted in between the two radio buttons.

More over i want to enable one radio button at a time.

Please help me.

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

hi,

to enable 1 radio button at a time:

create a context attritute of say string type. then bind selectkey property of both the radio buttons to that attribute. now assign values of KeYTo Select property of both the radio buttons like give 'a' for 1st button and 'b' for second. now set the default value of that attribute to 'a', this will enable first button . create onaction methods for both the buttons.

to create space between them, use matrix layout.

i hope it helps

regards

arjun

Former Member
0 Kudos

like i have created a context as string and in the parameter of radio button i have done the binding on the selected key option. Im correct in that. shd i do binding on keytoselect or selected key.

>now assign values of KeYTo Select property of both the radio buttons like give 'a' for 1st button and 'b' for second.*

like how to do this thing?

Im nt getting it. Please explain.

arjun_thakur
Active Contributor
0 Kudos

hi,

bind SELECTEDKEY property of both the radio buttons to that attribute.

now give values to keyToselect property of both the buttons. enter value value say 'a' for 1st button and like that. enter it like we enter the text for the button (this is to make one button enabled by default ).

suppose you have given keyToselect value as 'a' to 1st button and 'b' to second button. and you want to that 1st button should be checked by default when you run the application. For that, give 'a' as the default value of that context attribute which you have already created.

i hope it explains.

regards

arjun

Former Member
0 Kudos

Arjun I have set the default value of the attribute to 'a' as it was my 1st radio button.

but im not able to select any of the radio button. non of the button is checked at the run time.

more over the at the execution time im getting an error as Context binding for property SELECTED_KEY of "R1" cannot be resolved: Node MAIN.1.COMPANY_CODE does not contain any elements

please suggest.

arjun_thakur
Active Contributor
0 Kudos

hi,

I am not sure why this is happening. Just follow the procedure correctly, i am sure you'll be able to do it.

As far as that error is concerned, bind SELECTEDKEY property of both the radio button to an attribute which is of STRING type.

i hope it helps.

regards

arjun

Former Member
0 Kudos

Madhvi,

If you are using RadioButton instead of RadioButtonGroupbyKey or RadioButtonGroupByIndex then Kindly check your Node Cardinality & Selection Property. Keep both of them 1..1 then it will work fine.

Thanks,

Ravin Joshi

Answers (1)

Answers (1)

pranav_nagpal2
Contributor
0 Kudos

hi Madhvi,

please see WDR_TEST_UI_ELEMENTS in you SAP for better undersatnding i m sure you will easily get it from example there......

also there is an component created by sap with name WDR_TEST_EVENTS you can see this component for every UI element.......

regards

Pranav

Edited by: Pranav Nagpal on Dec 5, 2008 5:54 AM

Former Member
0 Kudos

Hello Madhavi ,

The easiest solution would be to use the UI element RadioButtonGroupByKey.

You can find an example in the WD component WDR_TEST_EVENTS and the View is RADIOBTNGRPBYKEY.

Hope this solve your problem

Regards

Vivek