public class CmsValidationController extends java.lang.Object implements I_CmsValidationController
限定符和类型 | 字段和说明 |
---|---|
protected java.util.Collection<I_CmsFormField> |
m_fields
The list of form fields which should be validated.
|
protected java.util.Map<java.lang.String,CmsValidationQuery> |
m_validationQueries
A map containing all validation queries which should be executed asynchronously.
|
构造器和说明 |
---|
CmsValidationController(java.util.Collection<I_CmsFormField> fields,
I_CmsValidationHandler handler)
Creates a new validation controller for a list of form fields.
|
CmsValidationController(I_CmsFormField field,
I_CmsValidationHandler handler)
Creates a new validation controller for a single form field.
|
限定符和类型 | 方法和说明 |
---|---|
int |
getId()
Returns the id of this validation controller.
|
java.util.Set<java.lang.String> |
getValidatedFields()
Returns the set of fields which have been validated.
|
protected void |
internalStartValidation()
Starts the validation.
|
protected void |
onReceiveValidationResults(java.util.Map<java.lang.String,CmsValidationResult> results)
Internal method which is executed when the results of the asynchronous validation are received from the server.
|
void |
provideValidationResult(java.lang.String field,
CmsValidationResult result)
Reports the result of a synchronous validation.
|
void |
setFormValidator(java.lang.String formValidatorClass)
Sets the form validator class name for this validation controller.
|
void |
setFormValidatorConfig(java.lang.String formValidatorConfig)
Sets the form validator configuration string.
|
void |
startValidation()
Starts the validation.
|
void |
validateAsync(java.lang.String field,
java.lang.String value,
java.lang.String validator,
java.lang.String config)
Requests an server-side validation to be performed later.
|
protected java.util.Collection<I_CmsFormField> m_fields
protected java.util.Map<java.lang.String,CmsValidationQuery> m_validationQueries
public CmsValidationController(java.util.Collection<I_CmsFormField> fields, I_CmsValidationHandler handler)
fields
- the fields which should be validatedhandler
- the validation handlerpublic CmsValidationController(I_CmsFormField field, I_CmsValidationHandler handler)
field
- the form fieldhandler
- the validation handlerpublic int getId()
public java.util.Set<java.lang.String> getValidatedFields()
public void provideValidationResult(java.lang.String field, CmsValidationResult result)
I_CmsValidationController
provideValidationResult
在接口中 I_CmsValidationController
field
- the field nameresult
- the validation resultI_CmsValidationController.provideValidationResult(java.lang.String, org.opencms.gwt.shared.CmsValidationResult)
public void setFormValidator(java.lang.String formValidatorClass)
formValidatorClass
- the class name of the form validatorpublic void setFormValidatorConfig(java.lang.String formValidatorConfig)
a
formValidatorConfig
- the form validator configuration stringpublic void startValidation()
This uses the CmsValidationScheduler
, so the validation only starts after the currently running or scheduled
validations have finished running.
public void validateAsync(java.lang.String field, java.lang.String value, java.lang.String validator, java.lang.String config)
I_CmsValidationController
validateAsync
在接口中 I_CmsValidationController
field
- the field namevalue
- the value of the fieldvalidator
- the server-side validator class nameconfig
- the configuration string for the server-side validatorI_CmsValidationController.validateAsync(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
protected void internalStartValidation()
protected void onReceiveValidationResults(java.util.Map<java.lang.String,CmsValidationResult> results)
results
- the validation results