287
Views
6
Comments
Solved
Can I make a list behave like a radio group?
Application Type
Reactive

Hi everyone.

I have a list that looks like this:

Where each of the elements is just a tag with an Icon and an Expression inside of it.

I want this list to behave like a radio group: I want the user to only be able to select ONE option, and when they select another one their previous choice is unselected.

However, I've been having a lot of trouble trying to make that happen. Anyone got any good ideas for me?

Thanks in advance.

UserImage.jpg
Yizuhi Galaviz
Solution

Hey, I managed to solve my problem.

Turns out I simply wasn't assigning the value the user selected to any value...I can't believe I was so distracted.

Thanks for the help.

2020-11-10 23-58-16
Raphael Ranieri
 
MVP

Nice to know you solved it!! :)

About the background color you could use CSS styles to also make it happen using lists...

But button groups may also be a good solution!


Cheers and Regards,

RR :)

2020-11-10 23-58-16
Raphael Ranieri
 
MVP

Hi Yizuhi, what if instead of using radio group widget, you just created an onClick event in your cell.

This way you can make the onClick define some variable with the current line value.

When you click one row it will override the previous one.

This would work for you?


Cheers and Regards,

RR :)

2020-11-10 23-58-16
Raphael Ranieri
 
MVP

Made a sample for you...

Take a look:


When I click in the value my title change.

After you publish may take some seconds to populate the value to show in the screen.


Hope it helps,

RR :)

ListRadioLike.oml
2020-11-10 23-58-16
Raphael Ranieri
 
MVP

Hey Yizuhi,

Were you able to achieve your goal?

If not, don't hesitate to ask here and we can try to find another solution for you!

Cheers and Regards,

RR :)

UserImage.jpg
Yizuhi Galaviz

Hi.

Unfortunately no, I haven't been able to solve my problem. I did some progress though (I guess). Whit what I had before, I could select a tag, then select another tag and the previously selected tag would be unselected. But then it would stick to that tag no matter where I clicked. I couldn't select any other tag and the one tag wouldn't be deselected either.

With what I have now, however, my list of tags behaves more like a checkbox group: you can select as many tags as you want. But that's not what I want either.

I think a better example of how I want my list to behave is the Button Group widget rather than the Radio Group.

Your example does work, but I think it doesn't visually show the item you selected. I want the tag's background color to turn another color when it is selected.

Truly appreciate your help.

UserImage.jpg
Yizuhi Galaviz
Solution

Hey, I managed to solve my problem.

Turns out I simply wasn't assigning the value the user selected to any value...I can't believe I was so distracted.

Thanks for the help.

2020-11-10 23-58-16
Raphael Ranieri
 
MVP

Nice to know you solved it!! :)

About the background color you could use CSS styles to also make it happen using lists...

But button groups may also be a good solution!


Cheers and Regards,

RR :)

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