Skip to main content
1-Visitor
May 19, 2017
Solved

How to change Label and Colour of button dynamically

  • May 19, 2017
  • 4 replies
  • 7124 views

Hi,

Greetings!

We have a requirement to dynamically change the Label and Colour of a button based on the output of a service.

Can we do this?

I have also tried the workaround with Shape but it doesn't have text.

Any solution please?

Regards,

Plaban

Best answer by CarlesColl

Hi Folks,

The way to go with this kind of requirements are just the ValueDisplay widget, with it you can do everything he it's asking for.

Best Regards,

Carles.

4 replies

20-Turquoise
May 19, 2017

You could try a radiobuttion and state definitions, using a specific style for each state.

Alternatively, you may look into custom extensibility and developing or modifying existing widgets to feed style definitons based on the input.

5-Regular Member
May 22, 2017

Hi Plaban Patra​,

Have you tried placing the shape widget on a valueDisplay widget so that valueDisplay shows the text and ValueDisplay defines the color.

I hope it helps.

1-Visitor
May 22, 2017

you can try creating two different buttons with desired colour and labels on it then depending on the service result can hide or show the button and will work fine.

1-Visitor
May 22, 2017

Hi Folks,

The way to go with this kind of requirements are just the ValueDisplay widget, with it you can do everything he it's asking for.

Best Regards,

Carles.

5-Regular Member
May 22, 2017

Ah! yes, missed that. ValueDisplay has both StateFormatting and text. So, we don't require separate widgets for this requirement. Thanks Carles Coll