cancel
Showing results for 
Search instead for 
Did you mean: 

how to change the default radio button selection property

former_member205624
Contributor
0 Kudos

hi, to all

In my application there are two radio button and on initilization of a view by default a wrong radio button is selected. I want to change that. And want to select the other radio by default.

Please help me out.

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Jitender,

Assume that u r having 2 Radio buttons R1 and R2.

For this u create 3 attributes R1,R2 and Sel.

For the radio button R1:

set the element properties as:

keytoselect---R1

selected key --Sel

For the radio button R2:

set the element properties as:

keytoselect---R2

selected key --Sel

In implementation part :

public void wdDoInit()

{

//@@begin wdDoInit()

wdContext.currentContextElement().setR1("Pass");

wdContext.currentContextElement().setR2("Fail");

wdContext.currentContextElement().setSel("Pass");

//@@end

}

SO from the above code the default radio button R1 will be enabled.

If u want the second radio button to be default then change sel to

wdContext.currentContextElement().setSel("Fail");

so during run time when u select the first one automatically its selvalue changes according to the radio button's value.

Regards,

Krishnam Raju.

Former Member
0 Kudos

Set the selectedKey property to appropriate keyToSelect's value.