159
Views
3
Comments
Solved
Being able to deselect an item from a ButtonGroup
Question
Application Type
Reactive

Hi there.

I have a ButtonGroup widget in my screen, and I need the user to be able to deselect an item which they previously selected. Is there any way I could achieve this?

Any help would be appreciated :)

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Yizuhi,


That's not the default scenario but you can achieve that.

You have to set an event on the button group item onclick, like this:


And then on your action, you have an if to check if the value is selected (in my case Integer = 1), I set the variable to its default value (in my case -1), otherwise, I set the value to Integer = 1.


I send you an OML in attachment, you can see the button "First" which was the only one I implemented this logic.


Hope it helps.


Kind Regards,
João


ReactiveSandboxDeselectButtonGroup.oml
UserImage.jpg
Yizuhi Galaviz

Thank you so much, this is exactly what I needed. (I can't believe I didn't think of that before, though *facepalm*)

2021-06-09 13-39-18
Agno Silveira
 
MVP

Hi Yizuhi,

Can you explain more or send some images for we understand better what you need?

Look this example that i created:

See the example in attachment .OML

Regards.

ListExample.oml
2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Yizuhi,


That's not the default scenario but you can achieve that.

You have to set an event on the button group item onclick, like this:


And then on your action, you have an if to check if the value is selected (in my case Integer = 1), I set the variable to its default value (in my case -1), otherwise, I set the value to Integer = 1.


I send you an OML in attachment, you can see the button "First" which was the only one I implemented this logic.


Hope it helps.


Kind Regards,
João


ReactiveSandboxDeselectButtonGroup.oml
UserImage.jpg
Yizuhi Galaviz

Thank you so much, this is exactly what I needed. (I can't believe I didn't think of that before, though *facepalm*)

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