lumis.doui.control.datagrid
Class DataGridControl

Package class diagram package DataGridControl
java.lang.Object
  extended by lumis.doui.control.Control
      extended by lumis.doui.control.DataControl
          extended by lumis.doui.control.DataBoundControl
              extended by lumis.doui.control.datagrid.DataGridControl
All Implemented Interfaces:
Observer, VariableResolver, IControl, IDataBoundControl, IDataControl, IRenderer

public class DataGridControl
extends DataBoundControl

Used to render a data grid that allows the end user to manipulate multiple fields and rows of a given source.

This control by default reads the primary key and displayed fields of all the rows of the source, rendering a grid where each row corresponds to a source row and each cell represents a field of the source. The input control used for a field value is determined by the field definition.

To persist the changes made while using this control, an appropriate process action handler must be set. The process action handlers TableUpdateMultiRowDataProcessActionHandler and TableAddMultiRowDataProcessActionHandler may be used to do such persistence. The TableUpdateMultiRowDataProcessActionHandler is able to add new rows, update changed rows and delete removed rows, and is suitable for use in edit interfaces. The TableAddMultiRowDataProcessActionHandler adds all rows (it assumes all rows are new), and is suitable for use in add interfaces.

Example use:

<control:lum_dataGrid id="dataGridRelatedTerms" sourceId="termRelation" showHeader="false"/> xml data available for xsl rendering: <control id="dataGridRelatedTerms" showHeader="false" sourceId="termRelation" type="lum_dataGrid"> <control id="8A488A0311D83ABE0111D85DF1C60711" type="lum_interfaceHeaderButtons" .../> <control id="dataGridRelatedTerms.gridtable" type="lum_table"> <tr> <td> <control id="8A488A0311D83ABE0111D85DF1C60713" isVertical="true" listId="LumButton2" type="lum_buttonList" ... /> </td> <td> <control dataId="id" dataRow="1" id="dataGridRelatedTerms.1.id" sourceId="termRelation" type="lum_autoLayoutField" ... /> </td> <td> <control dataId="termId" dataRow="1" id="dataGridRelatedTerms.1.termId" sourceId="termRelation" type="lum_autoLayoutField" ... /> </td> <td> <control dataId="relationType" dataRow="1" id="dataGridRelatedTerms.1.relationType" sourceId="termRelation" type="lum_autoLayoutField" ... /> </td> <td> <control dataId="relatedTermId" dataRow="1" id="dataGridRelatedTerms.1.relatedTermId" sourceId="termRelation" type="lum_autoLayoutField" ... /> </td> </tr> </control> <data> <numberOfRows>1</numberOfRows> <rowsDeleted /> </data> </control>

Since:
4.0.4
See Also:
AutoLayoutFieldControl

Field Summary
protected  boolean showHeader
           
 
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_SCRIPT, onEventScripts, PARAMETER_TYPE_FIRST_SELECTED, PARAMETER_TYPE_GET_VALUE, parentControl, resources, type, VALIDATION_SELECTED_MANY, VALIDATION_SELECTED_ONE
 
Constructor Summary
DataGridControl()
           
 
Method Summary
protected  void addGridControls()
           
 void buildSubControls()
          For each field specified create a autoLayoutField control.
 void init(Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl)
           
 boolean isAllowAddRows()
           
 boolean isAllowDeleteRows()
           
 boolean isShowHeader()
           
 void loadFromRequest()
          Loads the number of rows and index of row to delete if exists.
protected  void reloadSubControlsRecursively(IControl currentControl)
           
 void setAllowAddRows(boolean allowAddRows)
           
 void setAllowDeleteRows(boolean allowDeleteRow)
           
 void setProcessActionHandlerParameters(IProcessActionHandler processActionHandler)
          Sets the control value as a process action handler parameter.
 void setRenderData()
          Sets information for rendering.
 void setShowHeader(boolean showHeader)
           
protected  void setSourceParameter(Source source, String parameterName)
          This control must not set source parameters.
protected  void setValueFromSource(Source source)
          Retrieves the number of rows in the source tabular data.
 
Methods inherited from class lumis.doui.control.DataBoundControl
autoAddDateTimeValueValidator, autoAddDoubleValueValidator, autoAddFileSizeValidator, autoAddIntegerValueValidator, autoAddLengthValidator, autoAddLongValueValidator, autoAddRequiredValueValidator, autoAddValidators, createConverter, createDataType, getDataId, getFieldName, getProcessActionHandlerParameterName, getReload, getRuntimeDefaultSource, getSource, getSourceById, getUnboundedConverter, setDefaultValue, setRawValue, setReload, setSourceParameters, setsSourceParameters, setValid, setValueFromSource, update
 
Methods inherited from class lumis.doui.control.DataControl
convertValueToControlValue, getConverter, getDataType, getDefaultValue, getParameterValue, getProcessActionIds, getRequestParameterName, getValue, getValue, getValueClass, initProcessActionIds, isTrim, loadSubControlFromRequest, loadSubControlsFromRequest, setProcessActionHandlerParameter, setProcessActionHandlerParameter, setTrim, setValue, valueIsArray
 
Methods inherited from class lumis.doui.control.Control
appendSubControl, appendSubControls, applyOnEventScripts, convertToStandardValue, createContainer, disconnect, fixedIdentifierRequired, generateControlId, getAdditionalParameters, getAdditionalParameters, getAncestor, getChildControls, getClientEventHandlerScript, getControlResource, getId, getLocale, getNamespace, getParentControl, getPrepareForReadScript, getRenderData, getResources, getScriptActionValidation, getScriptGetValues, getScriptGetValuesFunctionImplementation, getScriptGetValuesFunctionName, getScriptGetValuesRegistration, getSourceContext, getStringsToLocalize, getType, getValidationScript, isValid, localize, localizeStrings, processCustomTags, registerOnEventScript, removeChild, removeChildren, resolveVariable, 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.IDataControl
getConverter, getProcessActionIds, getValue, getValue, setValue
 
Methods inherited from interface lumis.doui.control.IControl
createContainer, disconnect, getChildControls, getControlResource, getId, getParentControl, getPrepareForReadScript, getRenderData, getResources, getType, isValid, registerOnEventScript, removeChild, removeChildren, setRuntimeAttributes
 
Methods inherited from interface lumis.doui.render.IRenderer
getResources, getSourceContext
 

Field Detail

showHeader

protected boolean showHeader
Constructor Detail

DataGridControl

public DataGridControl()
Method Detail

init

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

setValueFromSource

protected void setValueFromSource(Source source)
                           throws PortalException
Retrieves the number of rows in the source tabular data.

Overrides:
setValueFromSource in class DataBoundControl
Throws:
PortalException

reloadSubControlsRecursively

protected void reloadSubControlsRecursively(IControl currentControl)
                                     throws PortalException
Throws:
PortalException

buildSubControls

public void buildSubControls()
                      throws PortalException
For each field specified create a autoLayoutField control. In addition include an Add button and a Delete button for each row.

Specified by:
buildSubControls in interface IControl
Overrides:
buildSubControls in class DataBoundControl
Throws:
PortalException

addGridControls

protected void addGridControls()
                        throws PortalException
Throws:
PortalException

loadFromRequest

public void loadFromRequest()
                     throws PortalException
Loads the number of rows and index of row to delete if exists.

Specified by:
loadFromRequest in interface IDataControl
Overrides:
loadFromRequest in class DataBoundControl
Throws:
PortalException

setRenderData

public void setRenderData()
                   throws PortalException
Sets information for rendering. If a row is to be deleted, copy all the values in the rows below the row to be deleted to their previous row. Finally delete the last row. The only information that the data grid needs for itself is the number of rows.

Specified by:
setRenderData in interface IControl
Overrides:
setRenderData in class DataBoundControl
Throws:
PortalException

setProcessActionHandlerParameters

public void setProcessActionHandlerParameters(IProcessActionHandler processActionHandler)
                                       throws PortalException
Description copied from class: DataControl
Sets the control value as a process action handler parameter.

Specified by:
setProcessActionHandlerParameters in interface IDataControl
Overrides:
setProcessActionHandlerParameters in class DataControl
Throws:
PortalException

setSourceParameter

protected void setSourceParameter(Source source,
                                  String parameterName)
                           throws PortalException
This control must not set source parameters.

Overrides:
setSourceParameter in class DataBoundControl
Throws:
PortalException

isShowHeader

public boolean isShowHeader()

setShowHeader

public void setShowHeader(boolean showHeader)

isAllowAddRows

public boolean isAllowAddRows()

setAllowAddRows

public void setAllowAddRows(boolean allowAddRows)

isAllowDeleteRows

public boolean isAllowDeleteRows()

setAllowDeleteRows

public void setAllowDeleteRows(boolean allowDeleteRow)


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.