cancel
Showing results for 
Search instead for 
Did you mean: 

Setting default value in radiobutton group

Madhu2004
Active Contributor
0 Kudos

hai,

i am using radibuttongroupbykey with four values.

my requirement is set a radio button of the four as default when the screen comes for the first time. how to do this?

urgent.....

Madhu

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

in WDDOINIT method set the context attribute value to one of the possible values, the context attribute which you used in selectedKey property of the RadioButtonGroupByKey element.

wd_context->set_attribute( name = <context attribute> value = '<value>' ).

Regards

Abhimanyu L

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Pls set the lead selection of the node to which your radioButtonGroup is bound, to the default value u want.

if the radiobuttonGroup is radiobuttonGroupByKey, and the selectedKey is bound to attribute 'attr1' of NodeA and the default Key u want to set as selected in the group is key1

NodeA->SET_ATTRIBUTE(

NAME = 'attr1'

VALUE = ' key1' ).

if the radiobuttonGroup is radiobuttonGroupByIndx, set the Lead Selection Index of NodeA to the correct index

So if key1 is at index 5 in the Node,

NodeA->SET_LEAD_SELECTION_INDEX( 5 ).

Thanks

Former Member
0 Kudos

Since you would be using a value set to populate the four values, just do a set_attribute tby passing one of the values. That would be selected by default.

Regards,

Nithya

Madhu2004
Active Contributor
0 Kudos

hai nitya,

but i am not using any value_set. iam populating the values by attaching the domain.iam using radiobuttongroupbykey element.

Former Member
0 Kudos

Have you tried set_attribute with one of your values? I dont think the method of populating the values matters. It should work either way.

Regards

Nithya

Madhu2004
Active Contributor
0 Kudos

thanks ver much abimanyu and nitya , but one small final clarification, if i set the attribute in doint it will be only set for the first time, but if i want to do whenevr this screen comes?

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Madhu

You need to play with flags,

write the code in wdModifyView, which is called everytime screen is called, but you can put the code in conditions..

Regards

Abhimanyu L