Hi all,
I've a list records which is binds on the screen to list records widget and I want a radio button to be placed on List Item
where all radio buttons in the list to be selected by default and shouldn't unselect any of them.
Thanks,
Sai.
Hi @Jeevan Sai , can you share a sample?
Regards,
Luis Oliveira
Hi,
I'm attaching sample OML in which I want all the radio buttons to be selected.
Thanks in advance,
Hi Sai,
I don't think you can achieve the mentioned use-case by using the radio button widget. Instead, I would suggest you use the Checkbox widget with some customization.
Implementation Steps:
1) Use Checkbox widget instead of Radio Button widget
2) Replace the checkbox default Style Classes value with the predefined style class called radio-button and a custom class called cust-chkbox to the checkbox widget Style Classes field
3) Include the below-mentioned style rules in the screen style sheet section
CSS Snippet:
.cust-chkbox[type="checkbox"]:not(.checkbox) { -moz-appearance: inherit; appearance: inherit; }
4) Define the Local var mapped with the ListRecords widget as a Record List type, and it should contain a boolean attribute to track the checkbox selection in each row/record.
Note: In this implementation, you won't require an OnChange handler for the checkbox widget. Under the hood, the checkbox widget automatically updates the mapped boolean attribute value.
See this sample app: MultipleRadioBtnTask
I hope this helps you!
Kind regards,
Benjith Sam
Hi Jeevan,
I modify your oml with 2 version of what you asked for
test if this you are looking for, test it here
But the question here is what are you trying to achieve? as the use of the Radio usually is to choose one radio or another one, to have all checks marked (checked) its better to use the check box.
To avoid user to click change the enable to false
Cheers
Carlos Lessa
Hi Jeevan,pls check a sample of the implementation of the same onhttps://www.outsystems.com/forums/discussion/73260/all-radio-buttons-should-select-by-default-inside-a-list/Also Attached a Sample Oml