public interface ValidationTracker
Field
interfaces) and fields. It
is a one to many relationship, because each field may be called upon to render itself multiple times within a
request, because of Loop
or other similar components.
Internally, the tracker indexes its information in terms of the control name for
each rendering of the component (the mechanics of Tapestry ensures that this is unique within the form).
Validation trackers must be serializable, as they will almost always be stored into the HttpSession.
Trackers are used by only a single form within a single page; they are not threadsafe.Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all information stored by the tracker.
|
String |
getError(Field field)
Returns a previously recorded error message.
|
List<String> |
getErrors()
Returns a list of all error messages.
|
boolean |
getHasErrors()
Returns true if any field contains an error.
|
String |
getInput(Field field)
Returns a previously recorded input value.
|
List<String> |
getUnassociatedErrors()
Returns just the errors that are not associated with any fields.
|
boolean |
inError(Field field)
For a given field, determines if the field is "in error", meaning that an error message has been previously
recorded for the field.
|
void |
recordError(Field field,
String errorMessage)
Records an error message for a field.
|
void |
recordError(String errorMessage)
Records an error message that is not associated with any specific field.
|
void |
recordInput(Field field,
String input)
Called by a field to record the exact input from the user, prior to any validation.
|
void recordInput(Field field, String input)
field
- the field recording the inputinput
- the value obtained from the forms submissionvoid recordError(Field field, String errorMessage)
ValidationException
thrown by a Validator
or Translator
.field
- errorMessage
- void recordError(String errorMessage)
errorMessage
- boolean inError(Field field)
field
- boolean getHasErrors()
List<String> getErrors()
List<String> getUnassociatedErrors()
void clear()
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.