|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ValidationTracker
Tracks information related to user input validations. This information is:
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.
Method Summary | |
---|---|
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. |
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. |
Method Detail |
---|
void recordInput(Field field, String input)
field
- the field recording the inputinput
- the value obtained from the forms submissionString getInput(Field field)
void recordError(Field field, String errorMessage)
ValidationException
thrown by a Validator
or Translator
.
field
- errorMessage
- void recordError(String errorMessage)
errorMessage
- boolean inError(Field field)
field
-
String getError(Field field)
boolean getHasErrors()
List<String> getErrors()
void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |