net.sf.jolene.dom
Class Grid

java.lang.Object
  extended by net.sf.jolene.dom.HTMLElement
      extended by net.sf.jolene.dom.Grid
All Implemented Interfaces:
java.lang.Cloneable, IAttributes, ICollection, IStyles

public final class Grid
extends HTMLElement

A renderable data bound grid object. A grid is detected by the parser by having a table using an ID tag that starts with 'grid'. The grid object can be accessed in the document just like any other object. See the bind method to see how to 'datalink' the grid to a list of data objects.

Since:
Aug 1, 2005 5:54:59 PM
Author:
Dan Howard

Constructor Summary
Grid()
          Default constructor.
 
Method Summary
 void bind(java.util.List<GridColumn> header, java.util.List<java.lang.String> fields, java.util.List data)
          Binds the grid object to the specified data.
 Grid clone()
          Returns a clone of the grid object.
 java.lang.String toString()
          Renders the grid.
 
Methods inherited from class net.sf.jolene.dom.HTMLElement
clear, getAfterText, getAttribute, getBeforeText, getContent, getName, getStyle, getTag, getValue, hasAttribute, hasStyle, isChecked, isDisabled, isReadonly, isRenderable, keySet, removeAttribute, removeStyle, resetStyles, resetStyles, setAfterText, setAttribute, setBeforeText, setChecked, setContent, setDisabled, setName, setReadonly, setRenderable, setStyle, setStyles, setStyles, setValue, swapWith
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Grid

public Grid()
Default constructor.

Method Detail

bind

public void bind(java.util.List<GridColumn> header,
                 java.util.List<java.lang.String> fields,
                 java.util.List data)
          throws GridBindException
Binds the grid object to the specified data.

Parameters:
header - List of GridColumn objects defining the column information for the grid.
fields - List of fields (property names) which are accessed via PropertyUtils to set the values for each cell.
data - List of data objects used to retrieve the values.
Throws:
GridBindException - if PropertyUtils fails.

clone

public Grid clone()
Returns a clone of the grid object.

Overrides:
clone in class HTMLElement
Returns:
Grid object.
See Also:
DocumentFactory

toString

public java.lang.String toString()
Renders the grid.

Overrides:
toString in class HTMLElement
Returns:
Grid as html string.