Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
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
Solved! Go to Solution.
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.
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.
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.
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.
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.
Ah! yes, missed that. ValueDisplay has both StateFormatting and text. So, we don't require separate widgets for this requirement. Thanks Carles Coll
But What about the label on it, how to change it dynamically?
ValueDisplay accepts value binding you just need to return the desired text from a Service or a Expression Widget.
Thank you Carles Coll!
This solved the problem.