1 Reply Latest reply on Jan 9, 2018 12:24 PM by fmanniti RSS
    fmanniti Creator

    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?

      • Re: Is it possible to change boolean value with Button?
        carlesc Heavyweight Champ

        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