dataQuality inconsistent on components

We’re using the ‘dataQuality’ meta-property on one of our windows to determine if the window has completed loading before a script my be ran by the operator. It seems that not all the components have consistent behavior for this property.

For example, the ‘Text Field’ component gives values of -1, 0, and 1 for the quality value with -1 one indicating that the value was still being bound to the component. Whereas the ‘Check Box’ component only gives 0 and 1 for quality values.

The data quality property only shows whether or not a component has had a binding load on any of it’s properties. It really doesn’t have any bearing on when the window itself is finished loading.

At any rate, all components will start with it’s dataquality property at -1. If they have a binding it will change to reflect the state of the binding, and if it doesn’t it will stay at -1.

What we’re doing is loading a popup form with data. When the value of the Text Field or Check Box is modified we log the new value and old value to a database with the current user. The problem is that when the form loads and the initial state is set it fires off the propertyChange event so we’re logging x items that are totally irrelevant to our needs. Looking at a components dataQuality as -1 has been pretty reliable on the Text Field components so far, but we need a solution for the Check Boxs.

Any ideas?

What I usually do is add a custom property to the component called firstEvent that is a boolean. Save the window with the value “true” so it always opens that way initially. So when the first propertyChange event happens you check to see if the firstEvent is true and if so do nothing but set the firstEvent to false now. The next time we know it is because they clicked on the component.