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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Update icon style when datachange event fired

ptc-6291975
1-Newbie

Update icon style when datachange event fired

Hi,

May I know how do I update an icon style displayed on the Google map widget & tree widget (based on state-based formatting) whenever there is a data change event happened on a certain thing's property? I am able to display the icon style based on the property (bool type) state if manually/automatically reload the page. But I am not sure how to do this automatically whenever the data change event happen on the property?

Can you provide some advise on this (and provide some reference code snippet if scripting is required in this case)? I have tried invoke the Service that feed the data to Google Map and Tree widget through Javascript but it doesn't work. The same service if linked & invoked using ThingWorx mashup does work correctly so I guess is some issue with the java Scripting part?

Thanks in advance for your prompt support!

3 REPLIES 3

Hi,

To add on top of my previous question, I am trying to find out the way to programmatically change the icon style of the widgets from Javascript. I know i can achieve these through auto-refresh widget (and setting a very frequent update interval) but just feel it is kind of 'dirty' way to achieve this and might consume higher internet connection bandwidth?

Thanks.



Hi Yew,


At this time, the AutoRefresh widget is the only way to get 'automatic' updates on the client side.



Hi Pai,

If the Auto-refresh is the only way, then i am facing a problem here which need further assistance.

I am using auto-refresh to call the service (that get the network of thing and feed the data (All data) to Google Map and Tree widget). And based on the value received, show the icon using state-based formatting.

My issue here is, for example, I have 1 parent node and 2 child node, all displayed in Google map when page load (which is fine). However, when i select a node (in tree) or marker (in Google Map), the selection will be automatically cleared the next time auto-refresh event fires (say 1 second interval). Due to this, basically the tree node / Google marker is unselectable at all. And zoom level always zoom back to default zooming even after I manually zoom it. So it is really an issue as user just can't select anything or cannot zoom the Google Map.

Can you advise me what should i do in order to make this works?

Thanks in advance!



Top Tags