Putting an "onclick" handler to my button group options makes them unclickable?

Without an onclick event, I can click the buttons and they change colors to indicate which one is currently pressed. With the onclick event (I have the onclick event assigning a value to a client variable), they stop being highlighted. This is weird because I used buttongroups with onclick events before (for example to move to a different screen), and they worked fine and also highlighted the choice.

I'm working with reactive web app.

Any ideas?

Akis M wrote:

Without an onclick event, I can click the buttons and they change colors to indicate which one is currently pressed. With the onclick event (I have the onclick event assigning a value to a client variable), they stop being highlighted. This is weird because I used buttongroups with onclick events before (for example to move to a different screen), and they worked fine and also highlighted the choice.

I'm working with reactive web app.

Any ideas?

Hi Akis,

Can I see the oml to check what problem might be there since it works fine for button group but there must be something that you have missed or else, please upload oml so that I can see where might be the mistake.

Thankyou


Shailesh wrote:

Akis M wrote:

Without an onclick event, I can click the buttons and they change colors to indicate which one is currently pressed. With the onclick event (I have the onclick event assigning a value to a client variable), they stop being highlighted. This is weird because I used buttongroups with onclick events before (for example to move to a different screen), and they worked fine and also highlighted the choice.

I'm working with reactive web app.

Any ideas?

Hi Akis,

Can I see the oml to check what problem might be there since it works fine for button group but there must be something that you have missed or else, please upload oml so that I can see where might be the mistake.

Thankyou


Hi, unfortunately I can't export OML and share because it is an enterprise level app and thus confidential. Another clue that might help:


When I click on the buttons that are "not working", the action that assigns value to my client variable actually works. I checked my next screen where the values are displayed, and they correspond to the buttons clicked. The issue is that the button click does not become highlighted like all other button groups.


Akis M wrote:

Shailesh wrote:

Akis M wrote:

Without an onclick event, I can click the buttons and they change colors to indicate which one is currently pressed. With the onclick event (I have the onclick event assigning a value to a client variable), they stop being highlighted. This is weird because I used buttongroups with onclick events before (for example to move to a different screen), and they worked fine and also highlighted the choice.

I'm working with reactive web app.

Any ideas?

Hi Akis,

Can I see the oml to check what problem might be there since it works fine for button group but there must be something that you have missed or else, please upload oml so that I can see where might be the mistake.

Thankyou


Hi, unfortunately I can't export OML and share because it is an enterprise level app and thus confidential. Another clue that might help:


When I click on the buttons that are "not working", the action that assigns value to my client variable actually works. I checked my next screen where the values are displayed, and they correspond to the buttons clicked. The issue is that the button click does not become highlighted like all other button groups.


Hi Akis M,

have u visited these links?

these may help u.

https://www.outsystems.com/forums/discussion/44793/highlight-the-button-by-default/


https://www.outsystems.com/forums/discussion/44588/different-button-color-on-selecting-a-button-from-button-group-widget/

Thanks

Akis M wrote:

Shailesh wrote:

Akis M wrote:

Without an onclick event, I can click the buttons and they change colors to indicate which one is currently pressed. With the onclick event (I have the onclick event assigning a value to a client variable), they stop being highlighted. This is weird because I used buttongroups with onclick events before (for example to move to a different screen), and they worked fine and also highlighted the choice.

I'm working with reactive web app.

Any ideas?

Hi Akis,

Can I see the oml to check what problem might be there since it works fine for button group but there must be something that you have missed or else, please upload oml so that I can see where might be the mistake.

Thankyou


Hi, unfortunately I can't export OML and share because it is an enterprise level app and thus confidential. Another clue that might help:


When I click on the buttons that are "not working", the action that assigns value to my client variable actually works. I checked my next screen where the values are displayed, and they correspond to the buttons clicked. The issue is that the button click does not become highlighted like all other button groups.



That's alright, your action works but colors of button did not change, so did you change any CSS applied on the buttons and the button group, because it's the CSS that makes the color changes and these kind of features. Please check the styles applied on your button and the button group.


Akis M wrote:

Without an onclick event, I can click the buttons and they change colors to indicate which one is currently pressed. With the onclick event (I have the onclick event assigning a value to a client variable), they stop being highlighted. This is weird because I used buttongroups with onclick events before (for example to move to a different screen), and they worked fine and also highlighted the choice.

I'm working with reactive web app.

Any ideas?

Hi Akis,

I don't think onchange is creating issue because it always works for me. This issue may occure if you are using same variable (which you are using for button group value) with other element also on the screen.


Nikhil Gaur wrote:

Akis M wrote:

Without an onclick event, I can click the buttons and they change colors to indicate which one is currently pressed. With the onclick event (I have the onclick event assigning a value to a client variable), they stop being highlighted. This is weird because I used buttongroups with onclick events before (for example to move to a different screen), and they worked fine and also highlighted the choice.

I'm working with reactive web app.

Any ideas?

Hi Akis,

I don't think onchange is creating issue because it always works for me. This issue may occure if you are using same variable (which you are using for button group value) with other element also on the screen.


On this screen, I'm not using the same variable on any other element. I just have this button group with 3 buttons, each button changing the same variable but with different value. BUT... I am using this same button group, same variable, on other screens. Does this affect anything?


Shailesh wrote:

Akis M wrote:

Shailesh wrote:

Akis M wrote:

Without an onclick event, I can click the buttons and they change colors to indicate which one is currently pressed. With the onclick event (I have the onclick event assigning a value to a client variable), they stop being highlighted. This is weird because I used buttongroups with onclick events before (for example to move to a different screen), and they worked fine and also highlighted the choice.

I'm working with reactive web app.

Any ideas?

Hi Akis,

Can I see the oml to check what problem might be there since it works fine for button group but there must be something that you have missed or else, please upload oml so that I can see where might be the mistake.

Thankyou


Hi, unfortunately I can't export OML and share because it is an enterprise level app and thus confidential. Another clue that might help:


When I click on the buttons that are "not working", the action that assigns value to my client variable actually works. I checked my next screen where the values are displayed, and they correspond to the buttons clicked. The issue is that the button click does not become highlighted like all other button groups.



That's alright, your action works but colors of button did not change, so did you change any CSS applied on the buttons and the button group, because it's the CSS that makes the color changes and these kind of features. Please check the styles applied on your button and the button group.


I thought of that as well, I didn't change CSS at all, but I also deleted my button group and started it from scratch just in case I changed CSS accidentally and didn't remember. Same issue. Without my onclick events the buttons change colors, as soon as I add onclick event to a button, it stops getting highlighted when I click it.


Solution

Akis M wrote:

Shailesh wrote:

Akis M wrote:

Shailesh wrote:

Akis M wrote:

Without an onclick event, I can click the buttons and they change colors to indicate which one is currently pressed. With the onclick event (I have the onclick event assigning a value to a client variable), they stop being highlighted. This is weird because I used buttongroups with onclick events before (for example to move to a different screen), and they worked fine and also highlighted the choice.

I'm working with reactive web app.

Any ideas?

Hi Akis,

Can I see the oml to check what problem might be there since it works fine for button group but there must be something that you have missed or else, please upload oml so that I can see where might be the mistake.

Thankyou


Hi, unfortunately I can't export OML and share because it is an enterprise level app and thus confidential. Another clue that might help:


When I click on the buttons that are "not working", the action that assigns value to my client variable actually works. I checked my next screen where the values are displayed, and they correspond to the buttons clicked. The issue is that the button click does not become highlighted like all other button groups.



That's alright, your action works but colors of button did not change, so did you change any CSS applied on the buttons and the button group, because it's the CSS that makes the color changes and these kind of features. Please check the styles applied on your button and the button group.


I thought of that as well, I didn't change CSS at all, but I also deleted my button group and started it from scratch just in case I changed CSS accidentally and didn't remember. Same issue. Without my onclick events the buttons change colors, as soon as I add onclick event to a button, it stops getting highlighted when I click it.


I might got where you're stuck at, you need to set onclick action on button group or button?

if you want something to happen on click of a button in a button group then set onclick action on button group widget and it will work.

You might be setting onclick action on the button group items i. e. buttons and that is not a good approach since then you have to set on click on all of the buttons. Let me know if that works for you.

Thankyou


Solution