Package lumis.doui.control.validator
Class RegularExpressionValidatorControl
- java.lang.Object
-
- lumis.doui.control.Control
-
- lumis.doui.control.ValidatorControl
-
- lumis.doui.control.validator.RegularExpressionValidatorControl
-
- All Implemented Interfaces:
VariableResolver
,IControl
,IValidatorControl
- Direct Known Subclasses:
EmailValidatorControl
,FileNameValidatorControl
,NumberDataTypeValidatorControl
public class RegularExpressionValidatorControl extends ValidatorControl
Generates client side and server side validation that verifies that a control value if provided matches the regular expression specified in the expression attribute of the validator.
Example use:
xml data available for xsl rendering:<control:lum_regularExpressionValidator expression="[a-zA-Z0-9]+" />
<control expression="[a-zA-Z0-9]+" id="8A488A0311E0DDAE0111E1093B750265" type="lum_regularExpressionValidator"> <script><!-- validation javascript --></script> <data> <clientUniqueId>Form_8A488A0311E0DDAE0111E0F8A31800E28A488A0311E0DDAE0111E1093B750265</clientUniqueId> </data> </control>
- Since:
- 4.0.0
- Version:
- $Revision: 22315 $ $Date: 2019-01-25 18:30:16 -0200 (Fri, 25 Jan 2019) $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
expression
-
Fields inherited from class lumis.doui.control.ValidatorControl
clientSideValidationEnabled, DEFAULT_VALUE, ERROR_TYPE_CONTROL_BEING_VALIDATED_IS_NOT_CLIENT_SIDE_READABLE, ERROR_TYPE_ERROR_VALIDATING_CONTROL, messages, SOURCE_FIELD_NAME_UNDEFINED, validateOnClientSideEvents
-
Fields inherited from class lumis.doui.control.Control
childControls, controlContainer, controlDefinitionNode, controlResource, douiContext, hasValidatorSubControls, isValid, locale, ON_EVENT_CLOSE_WINDOW, ON_EVENT_LINK, ON_EVENT_POPUP_LINK_OR_RUNTIME_INTERFACE, ON_EVENT_POPUP_RUNTIME_INTERFACE, ON_EVENT_PROCESS_ACTION, ON_EVENT_RENDER_ACTION, ON_EVENT_REPLACE_INTERFACE, ON_EVENT_SCRIPT, ON_EVENT_VALIDATE, onEventScripts, PARAMETER_TYPE_FIRST_SELECTED, PARAMETER_TYPE_GET_VALUE, parentControl, resources, type, VALIDATION_SELECTED_MANY, VALIDATION_SELECTED_ONE
-
-
Constructor Summary
Constructors Constructor Description RegularExpressionValidatorControl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doServerValidation()
Performs the server validation of the controls for this validator.IResource
getControlResource()
protected ValidationMessages
getDefaultMessages(java.lang.String errorType)
java.lang.String
getScriptValidationFunctionImplementation()
Returns the client side code that must be placed in a client side function to perform the validationvoid
init(org.w3c.dom.Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl)
-
Methods inherited from class lumis.doui.control.ValidatorControl
getClientUniqueId, getControlToValidate, getControlToValidateIds, getControlToValidateSourceFieldName, getDefaultMessageParameters, getLocalizedErrorMessage, getMessages, getMessages, getScriptClear, getScriptSetMessages, getScriptSetMessages, getScriptSetMessages, getScriptValidate, getScriptValidateRegistration, getScriptValidationFunctionName, includeScripts, isClientSideValidationEnabled, isValidateOnlyIfVisible, serverValidate, setRenderData
-
Methods inherited from class lumis.doui.control.Control
appendSubControl, appendSubControls, applyOnEventScripts, buildSubControls, convertToStandardValue, createContainer, disconnect, fixedIdentifierRequired, generateControlId, generateControlIdPrefix, getAdditionalParameters, getAdditionalParameters, getAncestor, getChildControls, getClientEventHandlerScript, getId, getLocale, getName, getNamespace, getParentControl, getPrepareForReadScript, getRenderData, getResources, getRuntimeDefaultSource, getScriptActionValidation, getSourceContext, getStringsToLocalize, getType, getValidationScript, getWindowProperties, getWindowProperties, isRequired, isValid, localize, localizeStrings, processCustomTags, registerOnEventScript, removeChild, removeChildren, resolveVariable, setName, setRuntimeAttributes, setValid
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.doui.control.IControl
buildSubControls, createContainer, disconnect, getChildControls, getId, getName, getParentControl, getPrepareForReadScript, getRenderData, getResources, getType, isValid, registerOnEventScript, removeChild, removeChildren, setRuntimeAttributes, setValid
-
-
-
-
Method Detail
-
init
public void init(org.w3c.dom.Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl) throws PortalException
- Specified by:
init
in interfaceIControl
- Overrides:
init
in classValidatorControl
- Throws:
PortalException
-
doServerValidation
public boolean doServerValidation() throws PortalException
Description copied from class:ValidatorControl
Performs the server validation of the controls for this validator.- Overrides:
doServerValidation
in classValidatorControl
- Returns:
- false if the validation failed, true otherwise.
- Throws:
PortalException
- See Also:
ValidatorControl.serverValidate()
-
getScriptValidationFunctionImplementation
public java.lang.String getScriptValidationFunctionImplementation() throws PortalException
Description copied from interface:IValidatorControl
Returns the client side code that must be placed in a client side function to perform the validation- Returns:
- a String.
- Throws:
PortalException
-
getDefaultMessages
protected ValidationMessages getDefaultMessages(java.lang.String errorType) throws PortalException
- Overrides:
getDefaultMessages
in classValidatorControl
- Throws:
PortalException
-
getControlResource
public IResource getControlResource() throws PortalException
- Specified by:
getControlResource
in interfaceIControl
- Overrides:
getControlResource
in classValidatorControl
- Throws:
PortalException
-
-