Should able to Select only one radio button from the grid as shown in the below attachment.
a!radioButtonField( label: "Sort On", labelPosition: "COLLAPSED", choiceLabels: { "Yes" }, choiceValues: {true()}, value: fv!item.sortOn, saveInto: {local!sort, a!save(local!sortIndex,fv!index), a!save(index(ri!input,"sortOn",local!sortIndex,{}),true())}, choiceLayout: "STACKED", validations: {} )
How to achieve this please suggest.
Discussion posts and replies are publicly visible
Please, could you give a better context of what you need to do? Could you attach the complete code of the grid?
a!forEach( items: local!empCriteria, expression: a!columnsLayout( columns: { a!columnLayout( contents: { a!dropdownField( label: "Employee Dept", labelPosition: "COLLAPSED", placeholder: "--- Select a Value ---", choiceLabels: CONS!EMPDEPTLABELS, choiceValues: cons!EMPDEPTVALUES, value: fv!item.employeeDept, saveInto: fv!item.employeeDept, searchDisplay: "AUTO", required: true(), ) } ), a!columnLayout( contents: { a!radioButtonField( label: "Sort On", labelPosition: "COLLAPSED", choiceLabels: { "Yes" }, choiceValues: {true()}, value: fv!item.sortOn, saveInto: fv!item.sortOn, choiceLayout: "STACKED", validations: {} ) }, width: "EXTRA_NARROW" ), a!columnLayout( contents: { a!dropdownField( label: "Operator", labelPosition: "COLLAPSED", placeholder: "--- Select a Value ---", choiceLabels: cons!OPERATORS, choiceValues: cons!OPERATORS, value: fv!item.operator, saveInto: fv!item.operator, searchDisplay: "AUTO", validations: {}, required: true(), ) } ), a!columnLayout( contents: { a!dropdownField( label: "AND / OR", labelPosition: "COLLAPSED", placeholder: "--- Select a Value ---", choiceLabels: { "AND", "OR" }, choiceValues: { "AND", "OR" }, value: fv!item.gate, saveInto: fv!item.gate, searchDisplay: "AUTO", validations: {}, required: true(), ) } ) } ) ), a!buttonArrayLayout( align: "END", buttons: { a!buttonWidget( label: "Search", submit: true, saveInto: { a!save( ri!empCriteria, local!empCriteria ), a!save(ri!button, "Search"), }, style: "PRIMARY", loadingIndicator: true, ), a!buttonWidget( label: "Exit", value: "Exit", saveInto: ri!button, submit: true, style: "NORMAL", validate: false ) } )
I should able to select only on radio button out of five rows on the grid.For example if I select sortOn radio button on 3rd row and switch to 1st row then 3rd row radiobutton should be unselected and only 1st row radiobutton should act selected.
Let me know if this could help you
a!localVariables( local!value, local!empcriteria: { 0, 0, 0, 0 }, local!index, { a!forEach( items: local!empCriteria, expression: { a!boxLayout( contents: { a!radioButtonField( label: "Sort On", labelPosition: "COLLAPSED", choiceLabels: { 1, 2, 3, 4 }, choiceValues: { 1, 2, 3, 4 }, value: local!value, saveInto: { fv!item, local!index }, choiceLayout: "STACKED", validations: {} ) }, ), } ) } )
You can try the below code upon the keypress on the screen to achieve the requirement.
a!localVariables( local!empCriteria: { a!map(sortOn: null), a!map(sortOn: null), a!map(sortOn: null), a!map(sortOn: null), a!map(sortOn: null) }, { a!forEach( items: local!empCriteria, expression: a!columnsLayout( columns: { a!columnLayout( contents: { a!radioButtonField( label: "Sort On", labelPosition: "COLLAPSED", choiceLabels: { "Yes" }, choiceValues: { true() }, value: index(fv!item, "sortOn", null), saveInto: { a!save( local!empCriteria.sortOn, repeat(count(local!empCriteria), null) ), a!save(fv!item.sortOn, true()) }, choiceLayout: "STACKED", validations: {} ) }, width: "EXTRA_NARROW" ), } ) ), } )
Harshitha Mangamuri
Thanks for your response & code.Working 90% but when selecting the last radio button by default it is taking the before one also and when I click on any where on the screen it disappears and act as selected last one.