lumis.doui.control.validator
Class DateCompareValidatorControl
java.lang.Object
lumis.doui.control.Control
lumis.doui.control.ValidatorControl
lumis.doui.control.validator.DateCompareValidatorControl
All Implemented Interfaces: VariableResolver , IControl , IValidatorControl
public class DateCompareValidatorControl extends ValidatorControl
A date comparision validator control. This class is designed to compare the
date value of two Doui Controls that implement the
IClientSideReadableControl
. These controls must
implement a protected method named getScriptGetValuesFunctionImplementation
in which a client-side javascript code returns a array of size 2. On the
first position (index 0), the date must be returned. On the second position
(index 1), the time must be returned. In case the controls being validated
only contains date, this array must return on the second position a empty
string.
The XML structure for declaring this control is:
<control type="lum_dateCompareValidator" controlToValidateId="" compareToControlId="" operator="" dateFormat="" timeFormat="" />
controlToValidateId: This attribute must contain the Id of the Doui Control
that you want to validate. It can be ommited if the validation control is
declard within the control you want to validade.
compareToControlId: This attribute specifies the Id of the Doui Control you
want to compare the value of the control being validated.
operator: equal, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual.
dateFormat and timeFormat: specifies the date and time format. If not
declared, will use the default date format for the current language locale
being used.
Generates client side and server side validation that compares date values of two controls. The comparison may be either equal, lessThan, lessThanOrEqual, greaterThan or greaterThanOrEqual.
Example use:
xml data available for xsl rendering:
Form_8A488A031150E33501115107712D01FC8A488A03115BCABC01115BD4864700A4
Since:
4.0.9
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_SCRIPT , onEventScripts , PARAMETER_TYPE_FIRST_SELECTED , PARAMETER_TYPE_GET_VALUE , parentControl , resources , type , VALIDATION_SELECTED_MANY , VALIDATION_SELECTED_ONE
Methods inherited from class lumis.doui.control.ValidatorControl
getClientUniqueId , getControlToValidate , getControlToValidateIds , getControlToValidateSourceFieldName , getMessages , getMessages , getScriptClear , getScriptSetMessages , getScriptSetMessages , getScriptSetMessages , getScriptValidate , getScriptValidateRegistration , getScriptValidationFunctionName , 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
TYPE_OPERATOR_EQUAL
public static String TYPE_OPERATOR_EQUAL
TYPE_OPERATOR_LESS_THAN
public static String TYPE_OPERATOR_LESS_THAN
TYPE_OPERATOR_LESS_THAN_OR_EQUAL
public static String TYPE_OPERATOR_LESS_THAN_OR_EQUAL
TYPE_OPERATOR_GREATER_THAN
public static String TYPE_OPERATOR_GREATER_THAN
TYPE_OPERATOR_GREATER_THAN_OR_EQUAL
public static String TYPE_OPERATOR_GREATER_THAN_OR_EQUAL
CONTROL_PARAMETER_DATE_FORMAT_PATTERN
protected static final String CONTROL_PARAMETER_DATE_FORMAT_PATTERN
See Also: Constant Field Values
CONTROL_PARAMETER_TIME_FORMAT_PATTERN
protected static final String CONTROL_PARAMETER_TIME_FORMAT_PATTERN
See Also: Constant Field Values
dateFormat
protected String dateFormat
timeFormat
protected String timeFormat
operatorType
protected String operatorType
controlToValidateId
protected String controlToValidateId
compareToArgument
protected String compareToArgument
sdfDateTime
protected SimpleDateFormat sdfDateTime
sdfDate
protected SimpleDateFormat sdfDate
DateCompareValidatorControl
public DateCompareValidatorControl ()
init
public void init (Node controlDefinitionNode,
ControlContainer controlContainer,
IControl parentControl)
throws PortalException
Specified by: init
in interface IControl
Overrides: init
in class ValidatorControl
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 class ValidatorControl
Returns: false if the validation failed, true otherwise.
Throws:
PortalException
See Also: ValidatorControl.serverValidate()
getDefaultMessages
protected ValidationMessages getDefaultMessages (String errorType)
throws ControlException ,
PortalException
Overrides: getDefaultMessages
in class ValidatorControl
Throws:
ControlException
PortalException
getDefaultMessageParameters
protected String [] getDefaultMessageParameters ()
throws PortalException
Overrides: getDefaultMessageParameters
in class ValidatorControl
Throws:
PortalException
includeScripts
protected void includeScripts ()
throws ControlException ,
PortalException
Overrides: includeScripts
in class ValidatorControl
Throws:
ControlException
PortalException
getScriptValidationFunctionImplementation
public 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
getControlResource
public IResource getControlResource ()
throws PortalException
Specified by: getControlResource
in interface IControl
Overrides: getControlResource
in class ValidatorControl
Throws:
PortalException
Lumisportal 5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.