Class GridRows

  extended by org.apache.tapestry5.corelib.components.GridRows

public class GridRows
extends Object

Renders out a series of rows within the table.

Inside a Form, a series of row index numbers are stored into the form ( as ComponentActions). This can be a problem in situations where the data set can shift between the form render and the form submission, with a risk of applying changes to the wrong objects.

For this reason, when using GridRows inside a Form, you should generally provide a ValueEncoder (via the encoder parameter), or use an entity type for the "row" parameter for which Tapestry can provide a ValueEncoder automatically. This will allow Tapestry to use a unique ID for each row that doesn't change when rows are reordered.

Component Parameters
NameDescriptionTypeFlagsDefaultDefault PrefixSince
columnIndexOptional output parameter that stores the current column index.intprop
currentPageThe current page number within the available pages (indexed from 1).intRequiredprop
encoderA ValueEncoder used to convert server-side objects (provided by the "row" parameter) into unique client-side strings (typically IDs) and back. In general, when using Grid and Form together, you should either provide the encoder parameter or use a "row" type for which Tapestry is configured to provide a ValueEncoder automatically. Otherwise Tapestry must fall back to using the plain index of each row, rather than the ValueEncoder-provided unique ID, for recording state into the
gridModelObject that provides access to the bean and data models used to render the
leanIf true, then the CSS class on each TD cell will be omitted, which can reduce the amount of output from the component overall by a considerable amount. Leave this as false, the default, when you are leveraging the CSS to customize the look and feel of particular columns.booleanprop
overridesWhere to search for property override, Not Nullprop
rowThe current row being rendered, this is primarily an output parameter used to allow the Grid, and the Grid's container, to know what object is being rendered.ObjectRequiredprop
rowClassParameter used to set the CSS class for each row (each tr element) within the tbody). This is not cached, so it will be recomputed for each row.StringNot Cachedprop
rowIndexOptional output parameter (only set during rendering) that identifies the current row index. This is the index on the page (i.e., always numbered from zero) as opposed to the row index inside the org.apache.tapestry5.grid.GridDataSource.intprop
rowsPerPageNumber of rows displayed on each page. Long result sets are split across multiple pages.intRequiredprop
volatileIf true and the component is enclosed by a Form, then the normal state saving logic is turned off. Defaults to false, enabling state saving logic within Forms. This can be set to false when form elements within the Grid are not related to the current row of the grid, or where another component (such as org.apache.tapestry5.corelib.components.Hidden) is used to maintain row state.booleanprop

Constructor Summary
Method Summary
 String getCellClass()
 String getPropertyName()
 List<String> getPropertyNames()
 String getRowClass()
 void setPropertyName(String propertyName)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public GridRows()
Method Detail


public String getRowClass()


public String getCellClass()


public List<String> getPropertyNames()


public String getPropertyName()


public void setPropertyName(String propertyName)

Copyright © 2003-2012 The Apache Software Foundation.