net.sf.click.extras.control
Class FieldColumn

java.lang.Object
  extended bynet.sf.click.control.Column
      extended bynet.sf.click.extras.control.FieldColumn
All Implemented Interfaces:
Serializable

public class FieldColumn
extends Column

Provides a FieldColumn for rendering table data cells.

The FieldColumn class is used to define the table cell data <td> editors. Each FieldColumn should include a Field instance.

If the FieldColumn is contained in a standard Table it will render the all the table column data cells using its single field instance.

If the FieldColumn is contained in a FormTable it will both render the column data cells and process any posted column data values using the field instance. Changes to the tables data objects will be available in the Table rowList property.

Please see the FormTable Javadoc for usage examples.

Author:
Malcolm Edgar
See Also:
Column, FormTable, Serialized Form

Field Summary
protected  Field field
          The columns field to process and render.
 
Fields inherited from class net.sf.click.control.Column
attributes, autolink, dataClass, dataStyles, decorator, escapeHtml, format, headerClass, headerStyles, headerTitle, maxLength, messageFormat, methodCache, name, renderId, sortable, table, titleProperty, width
 
Constructor Summary
FieldColumn()
          Create a FieldColumn with no name or field defined.
FieldColumn(String name)
          Create a table field column with the given property name.
FieldColumn(String name, Field field)
          Create a table field column with the given property name and field.
FieldColumn(String name, String title)
          Create a table field column with the given property name and header title.
FieldColumn(String name, String title, Field field)
          Create a table field column with the given property name, header title and field.
 
Method Summary
 Field getField()
          Return the column editor field.
protected  void renderTableDataContent(Object row, HtmlStringBuffer buffer, Context context, int rowIndex)
          Render the content within the column table data <td> element.
 void setField(Field field)
          Set the column editor field.
 
Methods inherited from class net.sf.click.control.Column
getAttribute, getAttributes, getAutolink, getComparator, getDataClass, getDataStyle, getDataStyles, getDecorator, getEscapeHtml, getFormat, getHeaderClass, getHeaderStyle, getHeaderStyles, getHeaderTitle, getId, getMaxLength, getMessageFormat, getName, getProperty, getProperty, getRenderId, getSortable, getTable, getTitleProperty, getWidth, hasAttributes, hasDataStyles, hasHeaderStyles, renderLink, renderTableData, renderTableHeader, setAttribute, setAutolink, setComparator, setDataClass, setDataStyle, setDecorator, setEscapeHtml, setFormat, setHeaderClass, setHeaderStyle, setHeaderTitle, setMaxLength, setMessageFormat, setName, setRenderId, setSortable, setTable, setTextAlign, setTitleProperty, setVerticalAlign, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

field

protected Field field
The columns field to process and render.

Constructor Detail

FieldColumn

public FieldColumn(String name)
Create a table field column with the given property name. The table header title will be set as the capitalized property name.

Parameters:
name - the name of the property to render

FieldColumn

public FieldColumn(String name,
                   Field field)
Create a table field column with the given property name and field.

Parameters:
name - the name of the property to render
field - the field to process and render

FieldColumn

public FieldColumn(String name,
                   String title)
Create a table field column with the given property name and header title.

Parameters:
name - the name of the property to render
title - the column header title to render

FieldColumn

public FieldColumn(String name,
                   String title,
                   Field field)
Create a table field column with the given property name, header title and field.

Parameters:
name - the name of the property to render
title - the column header title to render
field - the field to process and render

FieldColumn

public FieldColumn()
Create a FieldColumn with no name or field defined.

Please note the control's name must be defined before it is valid.

Method Detail

getField

public Field getField()
Return the column editor field.

Returns:
the column editor field

setField

public void setField(Field field)
Set the column editor field.

Parameters:
field - the column editor field

renderTableDataContent

protected void renderTableDataContent(Object row,
                                      HtmlStringBuffer buffer,
                                      Context context,
                                      int rowIndex)
Render the content within the column table data <td> element. If the FieldColumn has a decorator defined this will be used instead to render the table data cell.

Parameters:
row - the row object to render
buffer - the string buffer to render to
context - the request context
rowIndex - the index of the current row within the parent table