cancel
Showing results for 
Search instead for 
Did you mean: 

Radiobuttongroupbykey default selection

Former Member
0 Kudos

Hi

I am using radiobuttongroupbykey ui element. One radio button should be selected by default. How can i do it?

Thanks

Vidyadhar

Edited by: Vidyadhar N on Oct 1, 2008 3:07 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

if the attribute is of simple type.

then if you want to select second radio button ie male.

then in simple type see what is the enumeration value and enumeration text for the male.

then do the following to select the male.

wdContext.currentContextElement().set<Attribute bind to the radio buttons group>("enumeration value for male");

if example m is enumeration value and male is enumeration text then

wdContext.currentContextElement().set<Attribute bind to the radio buttons group>("m");

hope it helps.

Regards,

ramesh

Former Member
0 Kudos

Say you have bound the "selectedKey" property to some context attribute "key" and the "keyToSelect" property of the radio button that should be selected is "3". Then


wdContext.currentContextElement().setKey("3");

will select that radio button and deselect all others.

Armin

Former Member
0 Kudos

hi Armin,

im jus trying to do as u have suggested..

but we dont have the property 'keyToSelect' for a

radio button group by key

it is there only for a individual radio button..

how can we acheive this...

Regards,

Satya.

Former Member
0 Kudos

Sorry. That was for single radio buttons. For RadioButtonGroupByKey, just set the value of the context attribute to which the "selectedKey" property is bound.

This attribute must have a DDIC type with value set. If you have for example the value set


{("S", "Small"), ("M", "Medium"), ("L", "Large")}

then you can select the radio button for "Medium" with


wdContext.currentContextElement().setKey("M");

Armin