on 05-20-2009 7:18 AM
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?
Hi Yogesh,
I'd instead, create a SimpleType in the Local Dictionary, as a Enumeration:
Value: 1, No Description
Value: 2, No Description
You can use a RadioButtonGroupByKey, event onClick would do somethig like
String selectedValue = wdContext.currentXXElement.getRadioValue(); // Context Value, Radio Button;
if ("1".equals(selectedValue))
// Enable First Text, Disable Second..
else
// Enable Second, Disable First..
You will need two other Context Values to hold the boolean for TextFields.
Regards,
Daniel
Edited by: Daniel Ruiz on May 20, 2009 8:36 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thnks everybody.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
the approach you have followed is providing the result you need , then you can go ahead with
what you have done , and its a right approach you have followed .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.