ihave one radio button in editable grid so when i select one option it should be disabled how can i do it
Discussion posts and replies are publicly visible
You want to disable the whole radio button component when a specific item is selected?
Interesting requirement. Can you elaborate? What did you try? Code snippet?
Hi santhoshp0005,
You could use the disable property of a component to disable it and code it according to your selected value.
Here's a eg code snippet. It disables a text field when the radio button has a specific value (3 here)
You can use the local disableSelection variable to disable the radiobutton too / any other components similarly
a!gridLayout( headerCells: { a!gridLayoutHeaderCell(label: "Radio Button"), a!gridLayoutHeaderCell(label: "Data") }, rows: a!gridRowLayout( contents: { a!localVariables( local!radioButton: null, local!disableSelection: false(), local!textbox, { a!radioButtonField( choiceLabels: { "One", "Two", "Three" }, choiceValues: { 1, 2, 3 }, value: local!radioButton, saveInto: { local!radioButton, /*Disable selection of Text field when value is 3*/ a!save(local!disableSelection, save!value = 3) } ), a!textField( value: local!textbox, saveInto: local!textbox, disabled: local!disableSelection ) } ) } ) )
Yeah I think we need a lot more informaiton. Disabling the radio button when selecting an option frankly seems like a frustrating experience for the user to me. What if they select the option by accident? Now they can't change it back to something else?
Typically you disable input controls based upon the values selected in other input controls e.g., you have a radio button where you can select "Yes" or "No" and if you select, say, "No" then a logically related input text field is then disabled (although I'd recommend showing/hiding rather than disabling)
A tack on question here, is there a way to disable a single option for a radio button field?
Individual options cannot be disabled.
thank you
You could have different radio-button components with different showWhen conditions that would include/exclude the specific radio-button option in question. Or it may be more appropriate to choose a different input component e.g. a dropdown, where you could include/exclude an option depending on some condition.
ok thank you