cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Is it possible to change boolean value with Button?

fmanniti
9-Granite

Is it possible to change boolean value with Button?

I have a boolean property which is ON/OFF and I'd like to set it on mashup not through a checkbox but by clicking a button.

It means that if my property is true (ON), the button will turn it off and vice versa. Furthermore, I'd like the label of the button would be "On" in case the value is false and vice versa.

If it is not possible this, it would be fine also have two buttons: On and Off.

Can a button do this?

1 REPLY 1

You can do it in different ways:

  • Radio Button Widget, with two states On / Off, and send SelectedValue to the server to change On/Off
  • ValueDisplay Widget, it has a click event, you can have a server side method which changes current property value, something like: me.booleanProperty = !me.booleanProperty; and you bind the value display click event to that service
  • Two overlayed buttons , put one visible and the other invisible depending on the state, and when you click one, you update the server side property
Announcements

Top Tags