public class VFilledOnChoice extends VConditional
A radio button called "yes" is chosen by the user and this requires that a "yes_detail" field be filled out.
Constructor and Description |
---|
VFilledOnChoice(Form f,
String name,
String errorMessage,
ChoiceGroup cg,
String choiceValue,
Field[] postFields) |
VFilledOnChoice(Form f,
String name,
String errorMessage,
ChoiceGroup cg,
String choiceValue,
List postFields) |
Modifier and Type | Method and Description |
---|---|
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.
|
validate
getErrorMessage, getName, setErrorMessage, toString
public VFilledOnChoice(Form f, String name, String errorMessage, ChoiceGroup cg, String choiceValue, 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, String name, String errorMessage, ChoiceGroup cg, String choiceValue, Field[] postFields)
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.