public final class VFilledGroup extends FormValidator
Constructor and Description |
---|
VFilledGroup(Form f,
String name,
String errorMessage,
Field[] fields) |
VFilledGroup(Form f,
String name,
String errorMessage,
List fields) |
Modifier and Type | Method and Description |
---|---|
VFilledGroup |
allFilledOrEmpty()
This is the default mode.
|
VFilledGroup |
oneOrMoreFilled()
Calling this method will result in requiring that one or more
fields by filled (all the fields cannot be empty).
|
VFilledGroup |
onlyOneEmpty()
Calling this method will result in requiring that all fields
must be filled except for any one empty field.
|
VFilledGroup |
onlyOneFilled()
Calling this method will result in requiring that all fields be
empty except for exactly one filled field (any field).
|
boolean |
validate(FormData fd,
javax.servlet.http.HttpServletRequest req)
Validates multiple fields together.
|
getErrorMessage, getName, setErrorMessage, toString
public VFilledGroup(Form f, String name, String errorMessage, List fields)
fields
- a non-empty list containting fields to be
checked.public VFilledGroup(Form f, String name, String errorMessage, Field[] fields)
fields
- a non-empty array containting fields to be
checked.public VFilledGroup onlyOneEmpty()
public VFilledGroup onlyOneFilled()
public VFilledGroup oneOrMoreFilled()
public VFilledGroup allFilledOrEmpty()
public boolean validate(FormData fd, javax.servlet.http.HttpServletRequest req)
FormValidator
Important notes: Typically, validation should be skipped in the following circumstances:
DependentField
and the
DependentField#shouldValidate
method returns false.validate
in class FormValidator