Hi,
Ignition v.8.1.12
Is it possible somehow to catch propertyChange just once?
when I print event.propertyName, so it gives me a lot of "data" and some other properties were changed many times:
selectedColumn
data
Pressed
columnAttributesData
selectedColumn
columnAttributesData
Pressed
selectedRow
selectedRow
data
columnAttributesData
columnAttributesData
columnAttributesData
This situations is bad because I run some scripts on for example "data" property..
so it executes (in this case) 2 times... How to escape this?
That usually means you are manipulating the component in those events in ways that cause a cascade of further events. If you assign to any bindable property in a component, you generate that propertyâs event immediately. The script doing the property assignment pauses as the script for the âinnerâ event runs. This can recurse to extreme levels (usually freezing the UI). Also, some properties are changed by the component multiple times naturally in order to achieve correct operation: like assignment to data will cause two assignments to selectedRow to remove and then re-apply the value.
You cannot prevent these extra events. You must work around them, possibly using a state machine in a custom property to identify the case you really care about.
Share what you are trying to achieve and we might be able to provide more specific guidance.
When I press on cell, so I use âcellEditedâ event and also âpropertyChangeâ (events: data, selectedRow) at the same time.
When mouse released I call script from library, which sets an internal tag in TagBrowser a random value (when this value has changed so it calls Legacy Script).
The main idea all of this is: When I manipulate this table (setting/resetting cells), I set/reset some tags in Tag Browser and then I refresh this Table on every client who open this Graphic Display.
LegacyScript refreshes data for this Table.
Green color means the feedback from real variables, checkbox indicates internal variables, so when I manipulate these internal variables, I have to set real variables to internal values))) omg I canât even explain how my script works))) itâs so difficultâŚ
so. the logorythm:
client open Graphic display with this Table.
Sets/resets checkboxes (internal variables)
Every checkbox manipulation calls CONFIRM popup (system.gui.confirm)
When user confirms his choise, so the script is calling, which sets/resets real variables according to checkboxes (internal tags) values.
The LegacySCript checks the status of internal and real variables, sets/resets real values
Calling script which sets to memory variable random value to update Table (for indication), which makes changes to all users who has opened this Graphic Dosplay
No, if you are having a situation where propertyChange triggers multiple times you can end up in and infinity loop (undesired).
You probably need to enhance all the execution flow. If you can't explain what the script is doing, I doubt someone can help you with this. Personally I don't understand everything you've explained.