lumis.doui.control.validator
Class EmailValidatorControl

Package class diagram package EmailValidatorControl
java.lang.Object
  extended by lumis.doui.control.Control
      extended by lumis.doui.control.ValidatorControl
          extended by lumis.doui.control.validator.RegularExpressionValidatorControl
              extended by lumis.doui.control.validator.EmailValidatorControl
All Implemented Interfaces:
VariableResolver, IControl, IValidatorControl

public class EmailValidatorControl
extends RegularExpressionValidatorControl

Generates client side and server side validation that verifies that a control value if provided is formatted as a valid email address.

Example use:

<control:lum_emailValidator/> xml data available for xsl rendering: <control id="8A488A03115704960111570DB09C01C6" type="lum_emailValidator"> <script>function Validate_Form_8A488A03115169250111519610B501B6_8A488A0311570496011157142B5A0248() {var r, re;var s = LumisDouiGetValues('lumis.doui.control.inputtext.InputTextControl','Form_8A488A03115169250111519610B501B6','senderEmail');if (s == null) {LumisDouiValidatorSetMessages("Form_8A488A03115169250111519610B501B68A488A0311570496011157142B5A0248","<img src=\"lumis/portal/client/images/FieldFailedValidation.gif\"></img>","STR_CONTROL_BEING_VALIDATED_IS_NOT_CLIENT_SIDE_READABLE");LumisDouiErrorSummaryAddMessage('Form_8A488A03115169250111519610B501B6_lum_errorSummary',"STR_CONTROL_BEING_VALIDATED_IS_NOT_CLIENT_SIDE_READABLE"); return false;}if (s[0] == '') {LumisDouiValidatorSetMessages('Form_8A488A03115169250111519610B501B68A488A0311570496011157142B5A0248','','');return true; }re = new RegExp("^^([0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\\w]*[0-9a-zA-Z])\*\.)+[a-zA-Z]{2,9})$$", "g");r = (s[0].search(re) == -1);if(r) {LumisDouiValidatorSetMessages("Form_8A488A03115169250111519610B501B68A488A0311570496011157142B5A0248","<img src=\"lumis/portal/client/images/FieldFailedValidation.gif\"></img>","Sender: Invalid e-mail.");LumisDouiErrorSummaryAddMessage('Form_8A488A03115169250111519610B501B6_lum_errorSummary',"Sender: Invalid e-mail.");; return false;}return true;;}</script> <data> <clientUniqueId>Form_8A488A03115169250111519610B501B68A488A03115704960111570DB09C01C6</clientUniqueId> </data> </control>

Since:
4.0.7

Field Summary
protected static String DEFAULT_EXPRESSION
           
 
Fields inherited from class lumis.doui.control.validator.RegularExpressionValidatorControl
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, onEventScripts, PARAMETER_TYPE_FIRST_SELECTED, PARAMETER_TYPE_GET_VALUE, parentControl, resources, type, VALIDATION_SELECTED_MANY, VALIDATION_SELECTED_ONE
 
Constructor Summary
EmailValidatorControl()
           
 
Method Summary
 IResource getControlResource()
           
protected  ValidationMessages getDefaultMessages(String errorType)
           
 void init(Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl)
           
 
Methods inherited from class lumis.doui.control.validator.RegularExpressionValidatorControl
doServerValidation, getScriptValidationFunctionImplementation
 
Methods inherited from class lumis.doui.control.ValidatorControl
getClientUniqueId, getControlToValidate, getControlToValidateIds, getControlToValidateSourceFieldName, getDefaultMessageParameters, 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, getAdditionalParameters, getAdditionalParameters, getAncestor, getChildControls, getClientEventHandlerScript, getId, getLocale, getNamespace, getParentControl, getPrepareForReadScript, getRenderData, getResources, getRuntimeDefaultSource, getScriptActionValidation, getScriptGetValues, getScriptGetValuesFunctionImplementation, getScriptGetValuesFunctionName, getScriptGetValuesRegistration, getSourceContext, getStringsToLocalize, getType, getValidationScript, isValid, localize, localizeStrings, processCustomTags, registerOnEventScript, removeChild, removeChildren, resolveVariable, 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, getParentControl, getPrepareForReadScript, getRenderData, getResources, getType, isValid, registerOnEventScript, removeChild, removeChildren, setRuntimeAttributes, setValid
 

Field Detail

DEFAULT_EXPRESSION

protected static final String DEFAULT_EXPRESSION
See Also:
Constant Field Values
Constructor Detail

EmailValidatorControl

public EmailValidatorControl()
Method Detail

init

public void init(Node controlDefinitionNode,
                 ControlContainer controlContainer,
                 IControl parentControl)
          throws PortalException
Specified by:
init in interface IControl
Overrides:
init in class RegularExpressionValidatorControl
Throws:
PortalException

getDefaultMessages

protected ValidationMessages getDefaultMessages(String errorType)
                                         throws PortalException
Overrides:
getDefaultMessages in class RegularExpressionValidatorControl
Throws:
PortalException

getControlResource

public IResource getControlResource()
                             throws PortalException
Specified by:
getControlResource in interface IControl
Overrides:
getControlResource in class RegularExpressionValidatorControl
Throws:
PortalException


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.