public class OwDependentComboboxFieldControl extends OwFieldManagerControl
Configurable dependency FieldControl.
Can load values dependent on other field values, from different Data provider.
There two configuration nodes which are handled by default in the field control:
Active is an optional node, and define the context/provider type where the control should be active.
<Active search="true|false" edit="true|false" create="true|false" checkin="true|false" />
<DependentData> node
which provide the information of dependent handling.
<DependentData class="com.wewebu.ow.server.fieldctrlimpl.dynamic.OwDependentComboboxDataHandler">
...
<DependentData>
The <DependentData> can have an attribute class to define corresponding DependentDataHandler.
Definitions must implement the OwDependentComboboxDataHandler interface,
by default com.wewebu.ow.server.fieldctrlimpl.dynamic.OwDBDependentComboboxDataHandler is defined.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
| Modifier and Type | Field and Description |
|---|---|
static String |
EL_ACTIVE |
static String |
EL_DEPENDENT_DATA |
| Constructor and Description |
|---|
OwDependentComboboxFieldControl() |
| Modifier and Type | Method and Description |
|---|---|
protected OwComboModel |
createComboModel(OwField field,
List<OwComboItem> items)
(overridable)
Factory method for creation of the combo model, for combo box rendering.
|
protected OwXMLUtil |
getConfig() |
protected OwDependentComboboxDataHandler |
getDataHandler() |
protected void |
init()
init the target after the context is set.
|
void |
init(OwFieldManager fieldmanager_p,
Node configNode_p)
initialization of a field control to display fields
|
protected void |
insertComboField(Writer w,
OwFieldDefinition fieldDef,
OwField field,
String strID)
Render a combo box for value representations.
|
void |
insertEditField(Writer w,
OwFieldDefinition fieldDef,
OwField field,
String strID)
format and displays the value attached to the fieldClass in HTML for use in a HTML Form.
|
protected void |
insertEditTextField(Writer w,
OwFieldDefinition fieldDef,
Object currentValue,
String id)
(overridable)
Default rendering in case combo box should not be rendered.
|
void |
insertReadOnlyField(Writer w,
OwFieldDefinition fieldDef_p,
Object value_p)
format and displays the value attached to the PropertyClass in HTML
|
protected boolean |
isActiveContext()
(overridable)
Verify if this instance should be active in current context/ field provider type.
|
void |
onAjaxGetComboItems(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected void |
processDataResponse(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
List<OwComboItem> items) |
Object |
updateField(javax.servlet.http.HttpServletRequest request_p,
OwFieldDefinition fieldDef_p,
Object value_p,
String strID_p)
update the property value upon request and validates the new value.
|
getFieldManager, getFormEventFunction, getFormEventURL, getFormName, getFormTarget, insertLabelattach, detach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getID, onExternalRequest, onFormEvent, onRequest, setExternalFormTarget, updateExternalFormTargetpublic static final String EL_ACTIVE
public static final String EL_DEPENDENT_DATA
public void init(OwFieldManager fieldmanager_p, Node configNode_p) throws Exception
OwFieldManagerControlinit in class OwFieldManagerControlfieldmanager_p - OwFieldManager reference to the field manager containing the field controlconfigNode_p - DOM Node to the configuration XML for the control, or null to use defaultsExceptionprotected void init()
throws Exception
OwEventTargetinit in class OwFieldManagerControlExceptionpublic void insertReadOnlyField(Writer w, OwFieldDefinition fieldDef_p, Object value_p) throws Exception
OwFieldManagerControlinsertReadOnlyField in class OwFieldManagerControlw - Writer object to write HTML tofieldDef_p - OwFieldDefinition definition of fieldvalue_p - Object Value to be displayedExceptionpublic void insertEditField(Writer w, OwFieldDefinition fieldDef, OwField field, String strID) throws Exception
OwFieldManagerControlinsertEditField in class OwFieldManagerControlw - Writer object to write HTML tofieldDef - OwFieldDefinitionfield - OwField Value to be displayedstrID - ID of the HTML elementExceptionprotected void insertComboField(Writer w, OwFieldDefinition fieldDef, OwField field, String strID) throws OwException, IOException
getDataHandler(), afterwards the retrieved Data is converted into OwComboModel
representation calling createComboModel(OwField, List) method.w - WriterfieldDef - OwFieldDefinition of field to be renderedfield - OwField dependent fieldstrID - String for the rendered componentOwException - if rendering cannot be processed.IOExceptionprotected OwComboModel createComboModel(OwField field, List<OwComboItem> items) throws OwException
field - OwFielditems - List of OwComboItemsOwException - if cannot create model from provided informationprotected void insertEditTextField(Writer w, OwFieldDefinition fieldDef, Object currentValue, String id) throws OwException, IOException
w - WriterfieldDef - OwFieldDefinitioncurrentValue - Objectid - String for rendered representation itemOwExceptionIOExceptionpublic Object updateField(javax.servlet.http.HttpServletRequest request_p, OwFieldDefinition fieldDef_p, Object value_p, String strID_p) throws Exception
OwFieldManagerControlupdateField in class OwFieldManagerControlrequest_p - HttpServletRequestfieldDef_p - OwFieldDefinitionvalue_p - Object old ValuestrID_p - ID of the HTML elementExceptionprotected OwXMLUtil getConfig()
protected OwDependentComboboxDataHandler getDataHandler()
public void onAjaxGetComboItems(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws OwException,
IOException
OwExceptionIOExceptionprotected void processDataResponse(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
List<OwComboItem> items)
throws IOException
IOExceptionprotected boolean isActiveContext()
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.