public abstract class CustomValidator extends Validator
Modifier and Type | Field and Description |
---|---|
protected java.lang.Integer |
colNum |
protected DataSourceField |
dataSourceField |
protected DynamicForm |
dynamicForm |
protected FormItem |
formItem |
protected ListGrid |
listGrid |
protected ListGridField |
listGridField |
protected Record |
record |
protected java.lang.Object |
resultingValue |
protected java.lang.Integer |
rowNum |
protected java.util.Map |
validatorProperties |
factoryCreated, factoryProperties
Constructor and Description |
---|
CustomValidator() |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
condition(java.lang.Object value)
Add custom validation logic by overriding this method.
|
java.lang.Integer |
getColNum()
The column number of the cell currently being validated, if the component being validated is a ListGrid.
|
DataSourceField |
getDataSourceField()
DataSourceField on which this validator was declared.
|
DynamicForm |
getDynamicForm()
DynamicForm currently being validated.
|
FormItem |
getFormItem()
FormItem on which this validator was declared.
|
ListGrid |
getListGrid()
ListGrid currently being validated.
|
ListGridField |
getListGridField()
ListGridField on which this validator was declared.
|
Record |
getRecord() |
java.lang.Integer |
getRowNum()
The row number of the cell currently being validated, if the component being validated is a ListGrid.
|
java.util.Map |
getValidatorProperties()
Return the properties of validator that is defined on the DataSourceField.
|
protected void |
setResultingValue(java.lang.Object resultingValue)
To transform the incoming value that is validated into a different value or format set this property from Validator.condition() to the desired value.
|
addValidatorDefinition, create, getApplyWhen, getClientOnly, getCondition, getDependentFields, getOrCreateRef, getStopIfFalse, getStopOnError, getType, getTypeAsString, getValidateOnChange, setApplyWhen, setClientOnly, setCondition, setDependentFields, setErrorMessage, setStopIfFalse, setStopOnError, setType, setType, setValidateOnChange
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
protected FormItem formItem
protected DataSourceField dataSourceField
protected ListGridField listGridField
protected Record record
protected java.util.Map validatorProperties
protected java.lang.Object resultingValue
protected DynamicForm dynamicForm
protected ListGrid listGrid
protected java.lang.Integer rowNum
protected java.lang.Integer colNum
protected abstract boolean condition(java.lang.Object value)
getFormItem()
, getListGridField()
and getDataSourceField()
methods respectively.
The field values for the record being validated can be obtained by calling getRecord()
. The component being validated can be
obtained by calling getListGrid()
or getDynamicForm()
. If the component being validated is a ListGrid, the row and
column numbers identifying the cell being validated are accessible with the getRowNum()
and getColNum()
methods.value
- value to validatepublic FormItem getFormItem()
getListGridField()
or getDataSourceField()
should be called.
NOTE: FormItem will not be available during a save performed without a form (eg programmatic save) or if the field.public ListGridField getListGridField()
getFormItem()
or getDataSourceField()
should be called.public DataSourceField getDataSourceField()
getFormItem()
or getListGridField()
should be called.public ListGrid getListGrid()
getDynamicForm()
should be called.public DynamicForm getDynamicForm()
getListGrid()
should be called.public java.lang.Integer getRowNum()
public java.lang.Integer getColNum()
public java.util.Map getValidatorProperties()
protected void setResultingValue(java.lang.Object resultingValue)
resultingValue
- the resulting valuepublic Record getRecord()