fc.web.forms
Class VSelectValue
java.lang.Object
fc.web.forms.FieldValidator
fc.web.forms.VSelectValue
public final class VSelectValue
- extends FieldValidator
Validates that a select field has:
- some value(s)
- the values(s) are not a pre-specified value.
This is useful to see if the select field (popup) was selected by the user
(typically, select fields may be displayed with a dummy default
---choose an option--- type selection. In that case, we would
check to see if the select value was not ---choose an
option---.
|
Method Summary |
boolean |
validate(FormData fd,
javax.servlet.http.HttpServletRequest req)
Works with the Select field. |
VSelectValue
public VSelectValue(Select field,
String errorMessage,
String badSelectValue)
- Parameters:
field - the parent fieldbadSelectValue - the select value which will cause the
validation to failerrorMessage - error message for unsuccessful validation error.
validate
public boolean validate(FormData fd,
javax.servlet.http.HttpServletRequest req)
- Works with the
Select field.
- Specified by:
validate in class FieldValidator
- Throws:
ClassCastException - If the field's Field#getValue method
does not return a collection of
Select.Option objects