com.smartgwt.client.widgets.form.validator
Class RequiredIfValidator
java.lang.Object
com.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.widgets.form.validator.Validator
com.smartgwt.client.widgets.form.validator.RequiredIfValidator
public class RequiredIfValidator
- extends Validator
RequiredIf type validators should be specified with an expression
which takes three parameters:
- item - the DynamicForm item on which the error occurred (may be null)
- validator - a pointer to the
validator object
- value - the value of the field in question
When validation is perfomed, the expression will be evaluated - if it returns true
, the field will be
treated as a required field, so validation will fail if the field has no value.
Fields inherited from class com.smartgwt.client.core.JsObject |
jsObj |
Methods inherited from class com.smartgwt.client.core.DataClass |
doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsObject, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RequiredIfValidator
public RequiredIfValidator()
RequiredIfValidator
public RequiredIfValidator(RequiredIfFunction expression)
setExpression
public void setExpression(RequiredIfFunction expression)
- Set the expression.
- Parameters:
expression
- the expression