Hi,
I am updating a style definition to different colors based on a logic in my Thingworx screen.
But for the updated style to be reflected in the screen, I am reloading the whole page now.
Is it possible to see the updated style definitions in the screen without page reload?
Thank you in advance,
Sadagopan PSSKP
That is not possible to do, as the Styles are only loaded when the Runtime loads, so you always need a page reload.
Updating style definitions is not something that should be done at Runtime - I'm also curious how are you achieving this, maybe via XML manipulation?
Changing colors for different interface elements at runtime should be done through either State Definition or custom CSS classes that you can apply based on Expressions.
Thank you for the response.
But the requirement is, I need to update a place holder's background color based on the RGB color value string that I get from a Kepware Tag.
So now am using the deprecated label widget, assigned a Style Definition to it and am updating the Style Definition using UpdateStyleDefinition snippet. But I need to achieve background color change without reload.
Is there any other way that you can suggest for me to achieve this.?
Is the palette of colors so diverse that you can't pre-create CSS classes that can be set at runtime via the expression?
Eg: can't you create 10 CSS classes for the various colors used and apply these nicely?
Yes. I will not know what RGB value i will be getting to pre create CSS classes.
I need to assign the values to the background of the placeholder during runtime when the Kepware tag value changes.
Is there a way that you can recommend to do the above mentioned requirement?
style definition is rendered at mashup load so a reload is needed when it changed.
Developing your own widget which accept RGB parameter and render dynamially without reload could be a resolution.