Overview | Library | Tag | Help
| FRAMES NO FRAMES

## ICEfaces EE Composite Components
Tag editableTable

## The Editable Data Table Composite Component

### Features

- Offers direct, inline editing of row data
- Edits are done in a safe 'edit space' and the direct objects are untouched until the data is saved
- When a row is selected for editing, it becomes locked in edit mode until the changes are either saved or cancelled
- Supports editing of text, list, or date information
- Columns can be made editable or non-editable
- Supports a listener interface that will be called when a row is saved, so customized actions may be taken (eg. update the database)

### How To Use

1. Add the <ice-cc:editableTable/> tag to your page. Nest <ice-cc:css/> in your page <head> tag.
2. Bind the 'bean' attribute to an instance of EditableTableBean
3. If you would like to use the listener interface, create a class that implements the IEditableTableEventListener, and use the EditableTableBean(List,IEditableTableEventListener) overloaded constructor
4. Set the 'idProperty' attribute on the tag. This should correspond to the property on the row-level bean that is used to identify the row
5. For each column that you wish to be editable, choose the <ice-cc:textColumn/>, <ice-cc:selectOneMenuColumn/>, <ice-cc:selectBooleanColumn/>, or <ice-cc:selectInputDateColumn/> tags
6. Specify the 'title' attribute for each editable column tag
7. Specify the 'property' attribute for each editable column tag
8. Specify the 'width' attribute for each editable column tag
9. For <ice-cc:selectOneMenuColumn/>s, bind the 'selectItems' attribute to a list of SelectItems to be used in the associated drop down list
10. Nest converters and/or validators inside <ui:define name="converter"> and/or <ui:define name="validator"> tags:

         <ice-cc:selectInputDateColumn title="Birth Date"
         property="birthDate" width="150px"
         required="true">
         <ui:define name="converter">
         <f:convertDateTime dateStyle="short"/>
         </ui:define>
         </ice-cc:selectInputDateColumn>

11. For any columns that you do not wish to be made editable, use the <ice-cc:column/> tag in the following manner <ice-cc:column title="ID" value="#{row.id}" name="id"/> where 'row' is always the 'var' name used to access the property in the source dataTable.
12. Optionally specify whether the 1st ID column show be shown with the 'renderIdCol' attribute.

Example:

    <ice-cc:editableTable bean="#{editableTableExampleBean.editableTableBean}" id="editableTable" idProperty="id" renderIdCol="false"> <ice-cc:textColumn title="First Name" property="firstName" width="100px"/> <ice-cc:textColumn title="Last Name" property="lastName" width="100px"/> <ice-cc:selectOneMenuColumn title="Department" property="departmentName" selectItems="#{editableTableExampleBean.departments}" width="80px"/> <ice-cc:selectInputDateColumn title="Birth Date" property="birthDate" width="150px"> <f:convertDateTime dateStyle="default"/> </ice-cc:selectInputDateColumn> </ice-cc:editableTable>

Tag Information
Tag Class | javax.faces.webapp.FacetTag
TagExtraInfo Class | None
Body Content | tagdependent
Display Name | Editable Table

Attributes
Name | Required | Request-time | Type | Description
id | true | false | `java.lang.String` | A unique id for the component.
bean | true | false | `com.icesoft.faces.facelets.component.table.editable.EditableTableBean` | Must resolve to an instance of the EditableTableBean class
idProperty | true | false | `java.lang.String` | The name of the id property in your bean
renderIdCol | false | false | `java.lang.Boolean` | Flag indicating whether the id property's column will be rendered (default true).
rendered | false | false | `java.lang.Boolean` | Flag indicating whether this component should be rendered (during Render Response Phase), or processed on any subsequent form submit (default true).
deleteRows | false | false | `java.lang.Boolean` | Component level ability to delete table rows. Defaults to true.
addRows | false | false | `java.lang.Boolean` | Component level ability to add table rows. Defaults to true.
renderIdCol | false | false | `java.lang.Boolean` | Specify whether the ID column should be shown. Defaults to false.
rows | false | false | `java.lang.Integer` | Passed through to the ice:dataTable
showDataPagerInfo | false | false | `java.lang.Boolean` | Flag indicating whether or not the info dataPaginator in the header above the dataTable should be rendered (default true).
showDataPager | false | false | `java.lang.Boolean` | Flag indicating whether or not the dataPaginator in the dataTable footer should be rendered (default true).
showRowControls | false | false | `java.lang.Boolean` | Flag indicating whether or not the row controls in the dataTable footer should be rendered (default true).
panelStyle | false | false | `java.lang.String` | Passed through to the style attribute on the footer ice:panelGroup containing the dataPaginator and row controls.
multiple | false | false | `java.lang.Boolean` | Pass through attribute to ice:rowSelector component
preStyleOnSelection | false | false | `java.lang.Boolean` | Pass through attribute to ice:rowSelector component
toggleOnInput | false | false | `java.lang.Boolean` | Pass through attribute to ice:rowSelector component
style | false | false | `java.lang.String` | CSS style(s) to be applied when this component is rendered
styleClass | false | false | `java.lang.String` | Space-separated list of CSS style class(es) to be applied when this element is rendered.
readOnly | false | false | `java.lang.Boolean` | If set to true (default false) will not allow row editing, creation, or deletion
showMessagesInComp | false | false | `java.lang.Boolean` | If set to false (default true) will not display JSF messages inside the editable table. Messages will still be displayed in other ice:messages, or h:messages components on the page
disableMenus | false | false | `java.lang.Boolean` | If set to true (default false) will not display richt click popup menus for adding a new row
titleProperty | false | false | `java.lang.String` | The property of the row item to be rendered as the row-level column ouput title
fastStep | false | false | `java.lang.Integer` | Passed through to ice:dataPaginator
paginatorMaxPages | false | false | `java.lang.Integer` | Passed through to ice:dataPaginator

Variables
| No Variables Defined.

Overview | Library | Tag | Help
| FRAMES NO FRAMES

Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.