Package lumis.doui.control
Class DataBoundControl<S extends Source>
- java.lang.Object
-
- lumis.doui.control.Control
-
- lumis.doui.control.DataControl
-
- lumis.doui.control.DataBoundControl<S>
-
- Type Parameters:
S
- the source class for this control.
- All Implemented Interfaces:
Observer
,VariableResolver
,IControl
,IDataBoundControl
,IDataControl
,IRenderer
- Direct Known Subclasses:
AccountServiceInstancePaneControl
,AddDynamicListSourceControl
,AutoLayoutGenericAssociationInformationControl
,ChatMessageListControl
,ChatSendMessageControl
,CheckBoxControl
,CheckBoxListControl
,CommentAreaListControl
,CommentsControl
,ContentPickerControl
,DataGridControl
,DateTimePickerControl
,DocumentPickerControl
,DropDownListControl
,DynamicListControl
,EmailControl
,EnviromentPropertiesControl
,FieldsControl
,FilesPickerControl
,FileUploadControl
,GenericAclControl
,HtmlEditorControl
,InputCategoryControl
,InputProfileImageControl
,InputTagControl
,InputTextControl
,InputTextProxyControl
,ItemPickerControl
,LanguageControl
,LocalePickerControl
,MediaPickerControl
,MonthPickerControl
,MultiFileUploadControl
,MultiItemPickerControl
,NavigationControl
,OptionListControl
,OrderedMultiItemPickerControl
,PaginationControl
,PaneControl
,PasswordControl
,PrimaryKeyControl
,PrincipalPickerControl
,ProgressControl
,ProgressPanelControl
,PublishToPrincipalsControl
,PublishToPrincipalsListControl
,PublishToServiceInstancesControl
,PublishToServiceInstancesListControl
,PublishToSocialNetworkControl
,RadioButtonControl
,RadioButtonListControl
,SelectChannelChildControl
,SelectChannelOrChannelTemplateControl
,SelectImportFileControl
,SelectParentContentControl
,SelectParentContentTreeControl
,SelectWorkflowControl
,TabularDataControl
,TagControl
,TextControl
,TimePickerControl
,VersionControl
,WebFileReplicationPropertiesControl
,WorkflowAssignedToFilterControl
,WorkflowMetaDataControl
,WorkflowMetaDataControl
,WorkflowStateFilterControl
,WSRPCheckBoxListControl
,XslFileEditorControl
@StableMinor(version="14.2", sinceVersion="4.0") public abstract class DataBoundControl<S extends Source> extends DataControl implements Observer, IDataBoundControl
Control whose data is bound to a source.- Since:
- 4.0.0
- Version:
- $Revision: 24985 $ $Date: 2022-05-02 23:04:30 -0300 (Mon, 02 May 2022) $
-
-
Field Summary
-
Fields inherited from class lumis.doui.control.DataControl
FORCE_CASE_LOWER, FORCE_CASE_NONE, FORCE_CASE_UPPER, forceCase, requestParameterName, UNKNOWN_DATA_TYPE, value, valuePreviouslySet
-
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 DataBoundControl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
autoAddDateTimeValueValidator()
Deprecated.may be removed in the futureprotected void
autoAddDoubleValueValidator()
Deprecated.may be removed in the future.protected void
autoAddFileSizeValidator()
Deprecated.may be removed in the futureprotected void
autoAddIntegerValueValidator()
Deprecated.may be removed in the future.protected void
autoAddLengthValidator()
Deprecated.may be removed in the futureprotected void
autoAddLongValueValidator()
Deprecated.may be removed in the future.protected void
autoAddRequiredValueValidator()
Deprecated.may be removed in the futureprotected void
autoAddValidators()
void
buildSubControls()
protected IConverter
createConverter()
Creates the converter instance for this control.protected IDouiDataType
createDataType()
Creates the data type to be used for this control.String
getDataId()
Returns the fieldId of the source that the data bound control is associated toString
getFieldName()
Returns the field name that the data control is associated to.protected String
getProcessActionHandlerParameterName()
Define the name of the process action parameter to be set.protected boolean
getReload()
IDataControlRequestHelpDefinition
getRequestHelpDefinition()
Returns the request parameters help definition.protected Source
getRuntimeDefaultSource()
Returns default source to use in the context of the current control when evaluating runtime attributes.S
getSource()
Returns the source related to this data bound control.protected S
getSourceById(String sourceId)
ISourceContext
getSourceContext()
Returns the source context where this renderer belongs to.protected IConverter
getUnboundedConverter()
Deprecated.Since 4.0.10, this method is not used anymore.void
init(Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl)
void
loadFromRequest()
protected void
setDefaultValue()
protected void
setRawValue(Object value)
Sets directly the value in this control.void
setReload(boolean reload)
Sets the reload flag in the control.void
setRenderData()
protected void
setSourceParameter(String parameterName, String sourceId)
Set the parameter with the given name in source with the given identifier.void
setValid(boolean isValid)
protected void
setValueFromSource()
protected void
setValueFromSource(S source)
Reads the value corresponding to the current control from the control source.void
update(Observable src, Object args)
-
Methods inherited from class lumis.doui.control.DataControl
convertValueToControlValue, getConverter, getDataType, getDefaultValue, getParameterValue, getProcessActionIds, getRequestParameterName, getValue, getValue, getValueClass, initProcessActionIds, isTrim, loadSubControlFromRequest, loadSubControlsFromRequest, setProcessActionHandlerParameter, setProcessActionHandlerParameter, setProcessActionHandlerParameters, setSourceParameter, setSourceParameters, setTrim, setValue, valueIsArray
-
Methods inherited from class lumis.doui.control.Control
appendSubControl, appendSubControls, applyOnEventScripts, convertToStandardValue, createContainer, disconnect, fixedIdentifierRequired, generateControlId, generateControlIdPrefix, getAdditionalParameters, getAdditionalParameters, getAncestor, getChildControls, getClientEventHandlerScript, getControlResource, getId, getLocale, getName, getNamespace, getParentControl, getPrepareForReadScript, getRenderData, getResources, getScriptActionValidation, getStringsToLocalize, getType, getValidationScript, getWindowProperties, getWindowProperties, isRequired, isValid, localize, localizeStrings, processCustomTags, registerOnEventScript, removeChild, removeChildren, resolveVariable, setName, setRuntimeAttributes
-
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
createContainer, disconnect, getChildControls, getControlResource, getId, getName, getParentControl, getPrepareForReadScript, getRenderData, getResources, getType, isValid, registerOnEventScript, removeChild, removeChildren, setRuntimeAttributes
-
Methods inherited from interface lumis.doui.control.IDataControl
getConverter, getProcessActionIds, getValue, getValue, setProcessActionHandlerParameters, setValue
-
Methods inherited from interface lumis.doui.render.IRenderer
getResources
-
-
-
-
Method Detail
-
init
public void init(Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl) throws PortalException
- Specified by:
init
in interfaceIControl
- Overrides:
init
in classDataControl
- Throws:
PortalException
-
createDataType
protected IDouiDataType createDataType() throws PortalException
Creates the data type to be used for this control.For a data bound control, if no data type was specified in the control definition, the data type of its associated source field will be used, if any.
- Overrides:
createDataType
in classDataControl
- Returns:
- the data type to be used for this control, or null if this control does not knows which data type to use.
- Throws:
PortalException
-
createConverter
protected IConverter createConverter() throws PortalException
Description copied from class:DataControl
Creates the converter instance for this control.- Overrides:
createConverter
in classDataControl
- Returns:
- the converter instance or null if this control has no converter.
- Throws:
PortalException
-
setDefaultValue
protected void setDefaultValue() throws PortalException
- Overrides:
setDefaultValue
in classDataControl
- Throws:
PortalException
-
update
public void update(Observable src, Object args)
-
setSourceParameter
protected void setSourceParameter(String parameterName, String sourceId) throws PortalException
Description copied from class:DataControl
Set the parameter with the given name in source with the given identifier.- Overrides:
setSourceParameter
in classDataControl
- Parameters:
parameterName
- the parameter namesourceId
- the source identifier- Throws:
PortalException
-
getUnboundedConverter
@Deprecated protected IConverter getUnboundedConverter() throws PortalException
Deprecated.Since 4.0.10, this method is not used anymore. For best backward compatibility, this implementation delegates toDataControl.dataType
'sIDouiDataType.getConverter()
.Returns the converter to be used when this control is not bound to a source field.- Returns:
- the converter to be used when this control is not bound to a source field.
- Throws:
PortalException
- Since:
- 4.0.5
- See Also:
createDataType()
,createConverter()
,DataControl.getConverter()
-
setValueFromSource
protected void setValueFromSource() throws PortalException
- Throws:
PortalException
-
setValueFromSource
protected void setValueFromSource(S source) throws PortalException
Reads the value corresponding to the current control from the control source. By default the value that is taken from the source is from the first row of the source tabular data. However, if the control has the dataRow specified, the value taken from the source tabular data corresponds to specified row.- Parameters:
source
-- Throws:
PortalException
-
getSource
public S getSource() throws PortalException
Returns the source related to this data bound control.- Specified by:
getSource
in interfaceIDataBoundControl
- Returns:
- Throws:
PortalObjectNotFoundException
- if the sourceId referenced in the control does not exist.PortalException
-
getSourceById
protected S getSourceById(String sourceId) throws PortalException
- Throws:
PortalException
-
getReload
protected boolean getReload()
- Returns:
- Returns the reload.
-
setReload
public void setReload(boolean reload) throws PortalException
Description copied from interface:IDataBoundControl
Sets the reload flag in the control.- Specified by:
setReload
in interfaceIDataBoundControl
- Parameters:
reload
- The reload to set.- Throws:
PortalException
-
getDataId
public String getDataId() throws PortalException
Description copied from interface:IDataBoundControl
Returns the fieldId of the source that the data bound control is associated to- Specified by:
getDataId
in interfaceIDataBoundControl
- Returns:
- Returns the dataId.
- Throws:
PortalException
-
getFieldName
public String getFieldName() throws PortalException
Returns the field name that the data control is associated to. If the control has a fieldName attribute specified, that value is translated and returned. If not, the field name is taken from the source definition.- Specified by:
getFieldName
in interfaceIDataBoundControl
- Returns:
- Throws:
PortalException
-
loadFromRequest
public void loadFromRequest() throws PortalException
- Specified by:
loadFromRequest
in interfaceIDataControl
- Overrides:
loadFromRequest
in classDataControl
- Throws:
PortalException
-
getRuntimeDefaultSource
protected Source getRuntimeDefaultSource()
Description copied from class:Control
Returns default source to use in the context of the current control when evaluating runtime attributes.- Overrides:
getRuntimeDefaultSource
in classControl
- Returns:
- the default source, or null if there is no source.
-
setRenderData
public void setRenderData() throws PortalException
- Specified by:
setRenderData
in interfaceIControl
- Overrides:
setRenderData
in classControl
- Throws:
PortalException
-
setRawValue
protected void setRawValue(Object value) throws PortalException
Sets directly the value in this control.The value is set only if it differs of a previously set value. After the value is set in this control, the source parameters are set by calling
DataControl.setSourceParameters()
.- Overrides:
setRawValue
in classDataControl
- Parameters:
value
- the value to set.- Throws:
PortalException
- See Also:
DataControl.valuePreviouslySet
-
setValid
public void setValid(boolean isValid) throws PortalException
- Specified by:
setValid
in interfaceIControl
- Overrides:
setValid
in classControl
- Parameters:
isValid
- The isValid to set.- Throws:
PortalException
-
getProcessActionHandlerParameterName
protected String getProcessActionHandlerParameterName() throws PortalException
Define the name of the process action parameter to be set. If the control has a dataRow attribute will set the parameter with the following name "dataRow.dataId". Otherwise, the control´s dataId attribute will be used.- Overrides:
getProcessActionHandlerParameterName
in classDataControl
- Returns:
- parameter name
- Throws:
PortalException
-
buildSubControls
public void buildSubControls() throws PortalException
- Specified by:
buildSubControls
in interfaceIControl
- Overrides:
buildSubControls
in classControl
- Throws:
PortalException
-
autoAddValidators
protected void autoAddValidators() throws PortalException
- Throws:
PortalException
-
autoAddRequiredValueValidator
@Deprecated protected void autoAddRequiredValueValidator() throws PortalException
Deprecated.may be removed in the future- Throws:
PortalException
-
autoAddIntegerValueValidator
@Deprecated protected void autoAddIntegerValueValidator() throws PortalException
Deprecated.may be removed in the future.- Throws:
PortalException
-
autoAddLongValueValidator
@Deprecated protected void autoAddLongValueValidator() throws PortalException
Deprecated.may be removed in the future.- Throws:
PortalException
-
autoAddDoubleValueValidator
@Deprecated protected void autoAddDoubleValueValidator() throws PortalException
Deprecated.may be removed in the future.- Throws:
PortalException
-
autoAddDateTimeValueValidator
@Deprecated protected void autoAddDateTimeValueValidator() throws PortalException
Deprecated.may be removed in the future- Throws:
PortalException
-
autoAddLengthValidator
@Deprecated protected void autoAddLengthValidator() throws PortalException
Deprecated.may be removed in the future- Throws:
PortalException
-
autoAddFileSizeValidator
@Deprecated protected void autoAddFileSizeValidator() throws PortalException
Deprecated.may be removed in the future- Throws:
PortalException
-
getRequestHelpDefinition
public IDataControlRequestHelpDefinition getRequestHelpDefinition() throws PortalException
Description copied from interface:IDataControl
Returns the request parameters help definition. Used in process action REST API help. Must not return null.- Specified by:
getRequestHelpDefinition
in interfaceIDataControl
- Returns:
- the request parameters help definition. Used in process action REST API help. Must not return null.
- Throws:
PortalException
-
getSourceContext
public ISourceContext getSourceContext()
Description copied from interface:IRenderer
Returns the source context where this renderer belongs to.- Specified by:
getSourceContext
in interfaceIRenderer
- Overrides:
getSourceContext
in classControl
- Returns:
- the source context where this renderer belongs to.
-
-