@StableMinor(version="12.2", sinceVersion="4.0") public abstract class DataControl extends Control implements IDataControl, IRenderer
IDataControl
Modifier and Type | Field and Description |
---|---|
static String |
FORCE_CASE_LOWER |
static String |
FORCE_CASE_NONE |
static String |
FORCE_CASE_UPPER |
protected String |
forceCase |
protected String |
requestParameterName |
protected IDouiDataType |
UNKNOWN_DATA_TYPE
The instance used for dataType for controls for which the data type
is not known.
|
protected Object |
value |
protected boolean |
valuePreviouslySet |
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 and Description |
---|
DataControl() |
Modifier and Type | Method and Description |
---|---|
protected Object |
convertValueToControlValue(Object value,
Locale locale,
String pattern)
Method to centralize the implementation of conversion of a value to
this control's value.
|
protected IConverter |
createConverter()
Creates the converter instance for this control.
|
protected IDouiDataType |
createDataType()
Creates the data type to be used for this control.
|
IConverter |
getConverter()
Returns the converter that is able to convert this control's value.
|
protected IDouiDataType |
getDataType()
Returns the data type for this control.
|
protected Object |
getDefaultValue() |
protected Object |
getParameterValue(String parameterName)
Returns the value for this control, reading from request the parameters
based on the specified name.
|
protected String |
getProcessActionHandlerParameterName()
Define the name of the process action parameter to be set.
|
Set<String> |
getProcessActionIds()
Returns the process action identifiers for which this control sets parameters to.
|
protected String |
getRequestParameterName() |
Object |
getValue() |
<T> T |
getValue(Class<T> expectedClass) |
protected Class<?> |
getValueClass()
Returns the class the possible values of this control are assignable to.
|
void |
init(Node controlDefinitionNode,
ControlContainer controlContainer,
IControl parentControl) |
protected void |
initProcessActionIds()
Initializes the attribute
processActionIds . |
protected boolean |
isTrim()
Returns if the value for this control should be trimmed.
|
void |
loadFromRequest() |
protected void |
loadSubControlFromRequest(IControl control) |
protected void |
loadSubControlsFromRequest() |
protected void |
setDefaultValue() |
protected void |
setProcessActionHandlerParameter(IProcessActionHandler processActionHandler,
String parameterName)
Set the process action parameter with the control current value.
|
protected void |
setProcessActionHandlerParameter(IProcessActionHandler processActionHandler,
String parameterName,
Object value)
Set the process action parameter name and value.
|
void |
setProcessActionHandlerParameters(IProcessActionHandler processActionHandler)
Sets the control value as a process action handler parameter.
|
protected void |
setRawValue(Object value)
Sets directly the value in this control.
|
protected void |
setSourceParameter(Source source,
String parameterName)
Sets the parameter with the given name in the given source.
|
protected void |
setSourceParameter(String parameterName,
String sourceId)
Set the parameter with the given name in source with the given identifier.
|
protected void |
setSourceParameters()
Sets the appropriate source parameters.
|
protected void |
setTrim(boolean trim)
Sets if the value for this control should be trimmed.
|
void |
setValue(Object value)
Sets the value for this control.
|
boolean |
valueIsArray()
Returns true if the value in the control is expected to be an array.
|
appendSubControl, appendSubControls, applyOnEventScripts, buildSubControls, convertToStandardValue, createContainer, disconnect, fixedIdentifierRequired, generateControlId, generateControlIdPrefix, getAdditionalParameters, getAdditionalParameters, getAncestor, getChildControls, getClientEventHandlerScript, getControlResource, 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, setRenderData, setRuntimeAttributes, setValid
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRequestHelpDefinition
buildSubControls, createContainer, disconnect, getChildControls, getControlResource, getId, getName, getParentControl, getPrepareForReadScript, getRenderData, getResources, getType, isValid, registerOnEventScript, removeChild, removeChildren, setRenderData, setRuntimeAttributes, setValid
getResources, getSourceContext
public static final String FORCE_CASE_NONE
public static final String FORCE_CASE_UPPER
public static final String FORCE_CASE_LOWER
protected final IDouiDataType UNKNOWN_DATA_TYPE
createDataType()
,
getDataType()
protected String forceCase
protected Object value
protected boolean valuePreviouslySet
protected String requestParameterName
public void init(Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl) throws PortalException
init
in interface IControl
init
in class Control
PortalException
protected void initProcessActionIds() throws PortalException
processActionIds
.PortalException
public Set<String> getProcessActionIds() throws PortalException
IDataControl
getProcessActionIds
in interface IDataControl
PortalException
protected IDouiDataType createDataType() throws PortalException
PortalException
protected final IDouiDataType getDataType()
UNKNOWN_DATA_TYPE
is returned.createDataType()
protected IConverter createConverter() throws PortalException
PortalException
protected void setDefaultValue() throws PortalException
PortalException
protected Object getDefaultValue() throws PortalException
PortalException
protected Class<?> getValueClass() throws PortalException
This default implementation uses IDouiDataType.getValueClass()
of the data type of this control.
PortalException
protected Object convertValueToControlValue(Object value, Locale locale, String pattern) throws PortalException, ConversionException
Uses this control's converter to convert the value to this control's value class.
value
- the value.locale
- the locale to use in the conversion.pattern
- the pattern to use in the conversion.ConversionException
- if an exception is thrown by this control's
converter.PortalException
protected boolean isTrim()
setValue(Object)
method.protected void setTrim(boolean trim)
trim
- true to enable the trimming or false to disable it.
This does not affect the value already set in the control.isTrim()
public void setValue(Object value) throws PortalException
convertValueToControlValue(Object, Locale, String)
. Then
the value is set using setRawValue(Object)
.setValue
in interface IDataControl
value
- the value to set. It is automatically converted
as necessary.PortalException
protected void setRawValue(Object value) throws PortalException
value
- the value to set.PortalException
public Object getValue() throws PortalException
getValue
in interface IDataControl
PortalException
public <T> T getValue(Class<T> expectedClass) throws PortalException
getValue
in interface IDataControl
PortalException
protected String getRequestParameterName() throws PortalException
PortalException
public void loadFromRequest() throws PortalException
loadFromRequest
in interface IDataControl
PortalException
protected Object getParameterValue(String parameterName) throws PortalException
loadFromRequest()
calls this method when necessary,
to read the value to be set in the control.
parameterName
- the parameter name where the value is to be read from.
For controls that require multiple request parameters,
it is recommended to use the control's identifier as a prefix to
its parameter names during render, and then can implement this method
as using the given parameter name as the prefix.PortalException
public boolean valueIsArray() throws PortalException
PortalException
protected void loadSubControlsFromRequest() throws PortalException
PortalException
protected void loadSubControlFromRequest(IControl control) throws PortalException
PortalException
public void setProcessActionHandlerParameters(IProcessActionHandler processActionHandler) throws PortalException
setProcessActionHandlerParameters
in interface IDataControl
processActionHandler
- PortalException
protected void setProcessActionHandlerParameter(IProcessActionHandler processActionHandler, String parameterName) throws PortalException
processActionHandler
- the process action handlerparameterName
- the parameter namePortalException
protected void setProcessActionHandlerParameter(IProcessActionHandler processActionHandler, String parameterName, Object value) throws PortalException
processActionHandler
- the process action handlerparameterName
- the parameter nameparameterValue
- the parameter valuePortalException
protected String getProcessActionHandlerParameterName() throws PortalException
PortalException
public IConverter getConverter() throws PortalException
IDataControl
getConverter
in interface IDataControl
getConverter
in interface IRenderer
PortalException
protected void setSourceParameters() throws PortalException
PortalException
protected void setSourceParameter(String parameterName, String sourceId) throws PortalException
parameterName
- the parameter namesourceId
- the source identifierPortalException
protected void setSourceParameter(Source source, String parameterName) throws PortalException
source
- the sourceparameterName
- the parameter namePortalException
LumisXP 12.2.0.200122 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.