cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling InputFields through Radiobuttons

Former Member
0 Kudos

Hi,

I want to make an application in which there are three RadioButtons through RadioButtongroupBykey and one InputFields. On selecting the third radiobutton, the inputfield will be enable.

Please provide me the code for the same.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Manish,

--In the view create a RadioButtonsgroupByKey and an input field.

--Create a context attribute of type boolean and bound that to the enable property of the input field., say "enable_context"

--Now we need to set the value of "enable_context" based on the selection of the radiobutton.

--For this we need to create an Eventhanler , So create the action and pass the key value as parameter.

--Do parameter mapping in the method wdmodifyview()

--Inside the eventhandler now write your logic to set the value of "enable_context"

Best Wishes

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Manish

1)Set the keyToSelect =button_3 for Radio Button 3

2)Create a context value attribute of type String say <b>ButtonEnable</b> and bind that to the <b>selectedKey</b> property of Radio Button3.

3)Create a Boolean Value Attribute say "<b>EnableInputUI</b>" and bind that to the <b>Enable</b> property of InputField

onSelect() // radio Button 3

if(wdContext.currentContextElement().getButtonEnable().equals("button_3"));

wdContext.currentContextElement.setEnableInputUI(true);

Best Regards

Chaitanya.A

Former Member
0 Kudos

Hi,

create an attribute of type boolean and set it to false bind this to the enabled property of the text box.

use the action parameter key to find the selected key. IF that matches your third one make the enabled property of the text box to true.

Regards

Ayyapparaj