Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Radio Button Problem

Hello all,

Am new to WebDynpro. I have a requirement like this.

Radio Button1 - Input Field 1

Radio Button 2 - Input Field 2

When i select Radio 1 Input Field 1 Should be enabled and vice versa. At wdDoInit Radio Button 1 and Input Field 1 shoudl be enabled by default.

For this, i have created 5 context attributes

1) Va_RadioSelect (String) mapped to SelecetedKey of RadioButton1 and RadioButton2

2) Va_KeytoSelect1 (boolean) mapped to KeytoSelect of RaiodButton1

3) Va_KeytoSelect2 (boolean) mapped to KeytoSelect of RaiodButton2

4) Va_InputEnabled1 (boolean) mapped to Enabled of Input Field1

5) Va_InputEnabled2 (boolean) mapped to Enabled of Input Field2

Code

wdDoInit

va_keyToSelect1 (true)

va_keyToSelect2 (false)

va_InputFieldEnabled1 (true)

va_InputFieldEnabled2 (false)

onActionRadioButton1Selected

va_keyToSelect1 (true)

va_keyToSelect2 (false)

va_InputFieldEnabled1 (true)

va_InputFieldEnabled2 (false)

onActionRadioButton2Selected

va_keyToSelect1 (false)

va_keyToSelect2 (true)

va_InputFieldEnabled1 (false)

va_InputFieldEnabled2 (true)

Is this the right approach or is there a different simpler approach?

Former Member
Not what you were looking for? View more on this topic or Ask a question