Change Button Label when onclick


Hi,


Having a problem creating a button changing label when onclick for ex.

Button Label : "Hide" change to Button Label: "Show".


Cheers

Jed

Solution

hi, Jed,

Use variable to your label's value:

regards,

indra

Solution

Indra Budiantho wrote: Thank you very much Indra for the quick reply!       

hi, Jed,

Use variable to your label's value:

regards,

indra



I'm just getting started using Outsystems and had the same question about changing button text, but this answer from 2 years ago doesn't seem to apply any more. When I put a button object on the screen, the widget tree shows the text in a sub-object. I cannot reference a variable in the Text property -- I can only enter the text to appear on the button.

Am I missing something, or is changing the text of a button no longer possible?

Mark Noll wrote:

I'm just getting started using Outsystems and had the same question about changing button text, but this answer from 2 years ago doesn't seem to apply any more. When I put a button object on the screen, the widget tree shows the text in a sub-object. I cannot reference a variable in the Text property -- I can only enter the text to appear on the button.

Am I missing something, or is changing the text of a button no longer possible?

Hi Mark,

This answer is for treditional web apps and looks like you are developing reactive web app.

In reactive web app you can remove the text from button widget and add expression in its place. Now we will be able to assign your local variable to this expression and it will be changes as per your logic when you change the local variable text.


Yes, I'm trying out a reactive web app -- I be sure to post that with future questions.

I was trying to set the Text property of the text item, but following your comment I discovered a "Convert to Expression" option when I right-clicked on the text item. That did the trick and the button label is now set to my variable.

Thanks!