onValueChangeFunction

The onValueChangeFunction property identifies a function to be run each time a change occurs in the value of the field to which the property is assigned. EGL will call this function, using the user input as its only argument, during the JSF validation phase, but only if the value of the field has changed.

Use the EGL setError statement to indicate an error condition in the value change function.

Example

The following record will be displayed with the option for the user to change the fields:
Record CustomerRecord type BasicRecord
   customerName STRING {displayUse=input};
   creditOption INT {displayUse=input, onValueChangeFunction=checkOption};
end
The JSF handler contains a function at the same level as the onConstructionFunction or onPreRenderFunction named checkOption()
function checkOption(num int in)
	 if ((num < 0) || (num > 10))
      setError("Option must be between 1 and 9");
   end
end

Compatibility

Table 1. Support for onValueChangeFunction property
Data item JSF handler VGUI record Console UI Text Form Java™ Text Form COBOL Print Form Java Print Form COBOL
Yes Yes No No No No No No

Feedback