|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The AgiPropertyValidationListener interface is implemented by objects that participate in the validation process for controls on a form or page. AgfForm and AgpPage both implement this interface automatically. This interface can be implemented with another object if it is necessary to perform more validation than the form or page can support, namely for dynamically created controls that are unknown to the form or page at design time.
Like any "listener" interface, AgiPropertyValidationListener works in conjunction with objects that have a corresponding method addAgiPropertyValidationListener(). The only object in the SilverStream environment that has this method is the binding manager, which is present as agDataMgr in any form or page.
If an object is added as an AgiPropertyValidationListener to the binding manager, it will be notified with validation events for all controls on the form or page. Validation events occur when control values are changed by the user.
Method Summary | |
void |
validationFailed(AgoPropertyChangeEvent evt)
Called when an attempted new value for a control has been determined to be invalid. |
void |
validationTest(AgoPropertyChangeEvent evt)
Called when a control's value changes, either directly from user action or because of executed code. |
void |
valueChanged(AgoPropertyChangeEvent evt)
Called when a control's value has changed, and the value has been accepted by all applicable validation tests. |
Method Detail |
public void validationTest(AgoPropertyChangeEvent evt) throws AgoValidationException
evt
- an instance of an AgoPropertyChangeEvent, containing information about the old and new control values
To reject the new value of the control, construct and throw an AgoValidationException with its disposition set to AgoValidationException.FAIL.
Note that the control will keep its rejected value, but the value will not be propagated to data sources or other controls that may be bound to the control.
AgoValidationException
,
AgoPropertyChangeEvent
,
AgiPropertyValidationListener.validationFailed(AgoPropertyChangeEvent)
public void validationFailed(AgoPropertyChangeEvent evt) throws AgoValidationException
evt
- an instance of an AgoPropertyChangeEventThe validationFailed() method supplies an AgoPropertyChangeEvent event object which may be used to obtain the source of then change, a validation failed message, or other information.
Note that the control will keep its rejected value, but the value will not be propagated to data sources or other controls that may be bound to the control.
AgoPropertyChangeEvent
,
AgoValidationException
,
AgiPropertyValidationListener.validationTest(AgoPropertyChangeEvent)
public void valueChanged(AgoPropertyChangeEvent evt)
evt
- an instance of an AgoPropertyChangeEventThe valueChanged() method is called after the value has been validated. If the value is not valid, the valueChanged() method is not called.
The source can be determined using the evt.getChangeSource() method. One of these constants is returned:
AgoPropertyChangeEvent
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |