423
Views
9
Comments
Checkbox like radio button functionality

Thank you all!

I am wondering ,Did anyone implemented something like this or know how to implement:

1-There a list of records around 5-6 and the list consists of checkbox for each record.
2-The user should be able to select only one checkbox at a time-Something how a radio button works.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Naren,

A check box is a check box, a radio button is a radio button. Why don't you want to use a radio button? It is considered very bad UX to change the semantics of well-known widgets.

UserImage.jpg
Naren

Kilian Hekhuis wrote:

Hi Naren,

A check box is a check box, a radio button is a radio button. Why don't you want to use a radio button? It is considered very bad UX to change the semantics of well-known widgets.


Thanks

I tried using radio button too ,but still it is working same like checkbox.
If I click on a radio button and click on another radio button in the same list still both radio buttons are active.

2019-09-24 18-41-25
Jorge Martins
 
MVP

Hi Naren,

If it behaves like a radio button... why not use a radio button?

If you want to customize the look of a radio button you can use CSS, I believe SIlk UI and OutSystems UI already do this (so you can check how it's done for their case), or you can check this for something "close" to what you want (you may want to use the :before selector and maybe a font-awesome class to get the desired effect, for instance).

The desired behaviour, while still using the Checkbox widget, would require some coding (either JavaScript or OutSystems with Ajax Refreshes) to disable all other widgets in the same group, which I would avoid - more code, more chances of bugs.

Hope this helps

UserImage.jpg
Naren

Jorge Martins wrote:

Hi Naren,

If it behaves like a radio button... why not use a radio button?

If you want to customize the look of a radio button you can use CSS, I believe SIlk UI and OutSystems UI already do this (so you can check how it's done for their case), or you can check this for something "close" to what you want (you may want to use the :before selector and maybe a font-awesome class to get the desired effect, for instance).

The desired behaviour, while still using the Checkbox widget, would require some coding (either JavaScript or OutSystems with Ajax Refreshes) to disable all other widgets in the same group, which I would avoid - more code, more chances of bugs.

Hope this helps

I have implemented in other way around created a local variable to store the selected id and based on that condition ,toggle the checkbox and it is working fine.


2019-09-24 18-41-25
Jorge Martins
 
MVP

Naren,

You need to make sure both Radio Buttons share the same Variable (check this online lesson).

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Naren,

See attached a very simple module that has a working radio button.

TestRadioButtons.oml
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Naren,

I don't really understand what you mean. Have you checked (no pun intended) the Module I posted?

UserImage.jpg
Naren

Kilian Hekhuis wrote:

Hi Naren,

I don't really understand what you mean. Have you checked (no pun intended) the Module I posted?


No,Let me check it out!


UserImage.jpg
Yannick Mussche

The answer to this question is rather simple. So indeed, you take a checkbox instead of a radiobutton, and next you set style classes to "radio-button". This way you have something that looks like radiobutton, but has the functionality to toggle off and on, wihout having to select another radiobutton (like a checkbox).

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.