Skip to main content
1-Visitor
March 17, 2021
Question

Change state definition based on value in numeric entry or other value widget

  • March 17, 2021
  • 1 reply
  • 1126 views

Hi,

i have a state definition value for the value from a value display widget. Now i want to overwrite this state definition value (e.g. <30) and give a another value (e.g <20) which is defined by the user itself. 

 

I cannot change the state value property of the value widget even when i bind another value from a service to its source.It is not updating it. How can i achieve that? 

 

In this example it should take the color yellow instead of red because the thresholds are set as shown in the led widgets. The Statedefinition Values from the Value widget are binded to the same service as the led widgets. 

AS_9770512_0-1615994026942.png

 

1 reply

10-Marble
March 19, 2021

Hello,

I think that you can achieve that by modifying the StateDefinition entity through a service at runtime.

Resources["EntityServices"].UpdateStyleDefinition({
	name: undefined /* STYLEDEFINITIONNAME */,
	content: undefined /* JSON */
});

 Cyril