|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface used to communicate errors from an IValidatingTextField
component to some application-specific code. In addition,
controls how fields that are in error are presented (they can be
marked in various ways by the delegate; the default implementation
adds to red asterisks to the right of the field).
The interface is designed so that a single instance can be shared
with many instances of IValidatingTextField
.
TBD: Add another method so that the delegate can write additional attributes into the text field (i.e., to change its color or class).
Method Summary | |
void |
invalidField(IValidatingTextField field,
ValidationConstraint constraint,
java.lang.String defaultErrorMessage)
The error notification method, invoked during the rewind phase (that is, while HTTP parameters are being extracted from the request and assigned to various object properties). |
void |
writeAttributes(IValidatingTextField field,
IResponseWriter writer,
IRequestCycle cycle)
Invoked just before the <input type=text> element is closed. |
void |
writeErrorPrefix(IValidatingTextField field,
IResponseWriter writer,
IRequestCycle cycle)
Invoked before the field is rendered, if the field is in error. |
void |
writeErrorSuffix(IValidatingTextField field,
IResponseWriter writer,
IRequestCycle cycle)
Invoked after the field is rendered, if the field is in error. |
void |
writeLabelPrefix(IValidatingTextField field,
IResponseWriter writer,
IRequestCycle cycle)
Invoked by a FieldLabel just before writing the name
of the field. |
void |
writeLabelSuffix(IValidatingTextField field,
IResponseWriter writer,
IRequestCycle cycle)
Invoked by a FieldLabel just after writing the name
of the field. |
Method Detail |
public void invalidField(IValidatingTextField field, ValidationConstraint constraint, java.lang.String defaultErrorMessage)
Typically, the listener simply arrainges to present the defaultErrorMessage to the user (as part of the HTML response). Finicky listeners may, instead, use the constraint and displayName (from the field) to form their own error message.
field
- the field to which the update applies to.constraint
- the ValidationConstraint
which was violated.defaultErrorMessage
- a default, localized, error message.public void writeErrorPrefix(IValidatingTextField field, IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
public void writeAttributes(IValidatingTextField field, IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
public void writeErrorSuffix(IValidatingTextField field, IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
public void writeLabelPrefix(IValidatingTextField field, IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
FieldLabel
just before writing the name
of the field.public void writeLabelSuffix(IValidatingTextField field, IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
FieldLabel
just after writing the name
of the field.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |