|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfc.web.forms.FormValidator
fc.web.forms.VFilledGroup
public final class VFilledGroup
Validates that a group of fields is filled by the user. By default, every field must be filled. However, optionally it can be specified that every field in the group is not filled (all empty), only 1 field is filled or 1 or more fields (greater than zero) are filled.
Constructor Summary | |
---|---|
VFilledGroup(Form f,
java.lang.String name,
java.lang.String errorMessage,
Field[] fields)
|
|
VFilledGroup(Form f,
java.lang.String name,
java.lang.String errorMessage,
java.util.List fields)
|
Method Summary | |
---|---|
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. |
Methods inherited from class fc.web.forms.FormValidator |
---|
getErrorMessage, getName, setErrorMessage, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VFilledGroup(Form f, java.lang.String name, java.lang.String errorMessage, java.util.List fields)
fields
- a non-empty list containting fields to be
checked.public VFilledGroup(Form f, java.lang.String name, java.lang.String errorMessage, Field[] fields)
fields
- a non-empty array containting fields to be
checked.Method Detail |
---|
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |