netui-data:grid Tag

<netui-data:grid> Tag

The <netui-data:grid> tag renders data sets as an HTML table with the ability to page, sort, and filter the data set.

Syntax

<netui-data:grid
    [autoRender="boolean_autoRender"]
    dataSource="expression_dataSource"
    [imageRoot="string_imageRoot"]
    name="string_or_expression_name" />

Description

The <netui-data:grid> tag renders data sets as an HTML table with the ability to page, sort, and filter the data set. In addition, metadata about the data set may be used to effect aspects of the rendering.

The rendered table consists of three parts:

These parts are structured in a grid as follows:

column 1: headercolumn 2: headercolumn 3: header
column 1: data cellcolumn 2: data cellcolumn 3: data cell
column 1: data cellcolumn 2: data cellcolumn 3: data cell
column 1: data cellcolumn 2: data cellcolumn 3: data cell
column 1: footercolumn 2: footercolumn 3: footer

The grid is rendered either automatically or by nesting the following tags inside of a <netui-data:columns> tag:

If the grid is automatically rendered, the resulting HTML table is not sortable or filterable. Regardless of how a grid is rendered, a row is rendered for each item in the data set, unless a <netui-data:pager> tag is used to set the page size.

javax.sql.RowSet is the only type supported for rendering by the <netui-data:grid>. Any other types that are passed to the grid are illegal and an error will be reported in the JSP page.

Attributes

autoRenderA boolean that tells a <netui-data:grid> to render itself automatically. Automatic rendering of a dataset bypasses any user paramertization in rendering of the HTML table and disallows several features including sorts, filters, and paging.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

dataSourceA data binding expression that references the data set to be rendered by the <netui-data:grid>. This expression must resolve to an object of type javax.sql.RowSet or an error will be thrown and reported inline on the JSP page.
 
RequiredSupports runtime expression evaluationData bindable
YesNoYes

imageRootThe image root.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

nameThe name attribute of a grid is used to identify parameters in the URL that further determine how the HTML table is rendered. Specifically, the URL contains information about any sorts and filters that may be applied to a data set. The attribute should be should be unique within the scope of the pages where the grid may exist; if a <netui-data:grid> exists in a Page Flow, its grid name should be unique across the page flow so that parameters in the URL which are scoped to a particular grid on a particular page do not collide.
 
RequiredSupports runtime expression evaluationData bindable
YesNoYes

Sample

This sample shows a <netui-data:grid> tag that writes out two <netui-data:anchorColumn> and one <netui-data:basicColumn> .

   <netui-data:grid dataSource="{pageFlow.allRows}" name="{pageFlow.gridName}">
         <netui-data:gridStyle styleClassPrefix="gridStyle"/>
         <netui-data:pager renderInHeader="true" action="pageAction" renderInFooter="true"/>
             <netui-data:columns filterAction="begin" sortAction="begin">
                 <netui-data:anchorColumn action="detailsItems" addRowId="true" title="Details"/>
                 <netui-data:anchorColumn action="updateItems" addRowId="true" title="Edit"/>
                 <netui-data:basicColumn filterable="true" title="Itemnumber" sortable="true" name="itemnumber"/>
             </netui-data:columns>
     </netui-data:grid>

Code Sample

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_databinding/grid/grid.jsp

Related Topics

<netui-data:grid> Tag Sample

Presenting Complex Data Sets in JSPs

<netui-data:columns> Tag