cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

View updated Style definition without page reload

psskps
6-Contributor

View updated Style definition without page reload

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

6 REPLIES 6

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.

psskps
6-Contributor
(To:VladimirRosu)

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?

psskps
6-Contributor
(To:VladimirRosu)

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.

psskps
6-Contributor
(To:VladimirRosu)

Is there a way that you can recommend to do the above mentioned requirement?

wcui
14-Alexandrite
(To:psskps)

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.

Top Tags