Changing Background Color Conditionally Using the Data Pool Listener
By Scott Cannon
Have you ever had the need to change the background color on certain fields based on another
field such as a text field or combo box? This is a common need for required fields. With radio
buttons and check boxes this is very easy to do. Up until now, it was not possible to perform
this type of change with a text box or combo box because there is no such thing as State Change.
With the Form within a Form (Formlets) enhancement, this is now, not only possible, but
fairly easy to do.
Say you have a combo box (assigned component 2COMBO) with the following values:
Blue
Red
Other
You also have a text box called [Other Desc] for the user to enter a value if the combo box
value is “Other”. Currently, in the text box [Other Desc] you have on form
submit:
WHERE “2COMBO” EQ ‘OTHER’
THEN { REQ }
Until the user tries to exit the form they have no idea that the text box is required.
With the new enhancements there is a new object called a Data Pool Listener. This is
pretty much like the other controllers. It watches a component in the AUDA. If it
changes, it runs GUI commands.
In our example, you could add a Data Pool Listener (Add | Non-Visual | Data Pool Listener)
to the form:

You would define the Data Pool Listener to look at component 2COMBO.

In the GUI Commands:

The Data Pool Listener will fire when a new value is set to the component or a value is
deleted. If you set the component to the same value it already has, the Data Pool Listener
will not fire.
The Data Pool Listener will not fire until you leave the combo box control and after the edits
have been run to ensure that the value is allowable.
If you need additional information, please contact
scannon@getvitalized.com