|
||||||||||
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.VConditional
fc.web.forms.VFilledOnChoice
public class VFilledOnChoice
Validates that a certain radio or checkbox button selected (or not selected) implies that other fields in the form are also filled out. For example:
A radio button called "yes" is chosen by the user and this requires that a "yes_detail" field be filled out.
Constructor Summary | |
---|---|
VFilledOnChoice(Form f,
java.lang.String name,
java.lang.String errorMessage,
ChoiceGroup cg,
java.lang.String choiceValue,
Field[] postFields)
|
|
VFilledOnChoice(Form f,
java.lang.String name,
java.lang.String errorMessage,
ChoiceGroup cg,
java.lang.String choiceValue,
java.util.List postFields)
|
Method Summary | |
---|---|
VFilledOnChoice |
anyFilled(boolean val)
By default, this validator checks to see that all post-condition fields are filled. |
void |
onSelected(boolean val)
Sets whether validation will occur if the choice is selected by the user or not. |
boolean |
postConditionMet(FormData fd,
javax.servlet.http.HttpServletRequest req)
Subclasses should implement this method to check that certain post conditions have been met. |
boolean |
preConditionMet(FormData fd,
javax.servlet.http.HttpServletRequest req)
Subclasses should implement this method to check that certain fields or pre-conditions have been met. |
Methods inherited from class fc.web.forms.VConditional |
---|
validate |
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 VFilledOnChoice(Form f, java.lang.String name, java.lang.String errorMessage, ChoiceGroup cg, java.lang.String choiceValue, java.util.List postFields)
f
- the formname
- name for this validatorerrorMessage
- validation error messagechoice
- a pre condition choice groupval
- the specific value of the pre condition choice group
which will trigger the check to see that
post condition fields are filled outpostFields
- a non-empty list containing fields for
the post conditionpublic VFilledOnChoice(Form f, java.lang.String name, java.lang.String errorMessage, ChoiceGroup cg, java.lang.String choiceValue, Field[] postFields)
Method Detail |
---|
public VFilledOnChoice anyFilled(boolean val)
public boolean preConditionMet(FormData fd, javax.servlet.http.HttpServletRequest req)
VConditional
preConditionMet
in class VConditional
public boolean postConditionMet(FormData fd, javax.servlet.http.HttpServletRequest req)
VConditional
VConditional.preConditionMet(fc.web.forms.FormData, javax.servlet.http.HttpServletRequest)
method
returns true.
postConditionMet
in class VConditional
public void onSelected(boolean val)
val
- true to validate only when selected
false otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |