netui-data:anchorColumn Tag

<netui-data:anchorColumn> Tag

This tag renders a column with an HTML hyperlink in each data cell.

Syntax

<netui-data:anchorColumn
    [action="string_action"]
    [addRowId="boolean_addRowId"]
    [alt="string_alt"]
    [border="integer_border"]
    [filterAction="string_filterAction"]
    [filterable="boolean_filterable"]
    [height="integer_height"]
    [href="string_href"]
    [name="string_name"]
    [sortAction="string_sortAction"]
    [sortable="boolean_sortable"]
    [src="literal_or_expression_src"]
    [styleClassPrefix="string_styleClassPrefix"]
    title="string_title"
    [width="integer_width"] />

Description

This tag renders a column with an HTML hyperlink in each data cell. The anchor that is created is constructed from attributes on this tag and any nested <netui:parameter> or <netui:parameterMap> tags.

The hyperlink can be constructed in one of two ways: (1) using text provided in the title attribute or (2) using data from the current item in the data set. If using the title attribute, the column is not filterable or sortable as there is no data from the data set to filter or sort. If using data from the current item, the column can be filtered and sorted.

The <netui:anchorColumn> has the ability to render a clickable image inside the hyperlink. An image will be rendered if the src attribute is set and the name attribute is null. Otherwise, the data in the current data item that matches the name attribute will be rendered. If rendering an image using the src attribute, the column can be sorted and filtered on the name of the image.

In constructing an anchor from the attributes on the tag, exactly one of the href and action attributes must be specified. Providing both or neither will result in an error being reported.

Required resources:
The JavaScript file _grid.js must be included in any JSP page with a grid that uses a filter-enabled <netui:anchorColumn>. The New Page Flow Wizard (available at File-->New-->Page Flow) adds the _grid.js file to a project's /resources/grid directory, when you build a Page Flow over a database control. The JSP page should contain:

    <script language="javascript" src="/resources/grid/_grid.js"
        type="text/javascript"></script>

Attributes

actionThe action method invoked when the column header is clicked.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

addRowIdBoolean. If set to true, the record's unique identifier, often a primary key, will be encoded into the record's link.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

altThe alternate text to display in the browser if the image can not be displayed.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

borderInteger. The width of the border around the image.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

filterActionThe action method that will handle the filter operation.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

filterableBoolean. Determines whether or not the column is filterable
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

heightInteger. The height of the image to be displayed in pixels.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

hrefThe URL that is invoked when the column header is clicked.
 
RequiredSupports runtime expression evaluationData bindable
NoYesNo

nameSpecifies the RowSet field to be rendered by the <netui-data:basicColumn> tag. The name attribute specifies which data in the RowSet should be extracted and rendered as a column. The name attribute should match one of the fields in the RowSet schema.

For example, suppose you have the following RowSet schema (located in the RowSet control file), containing four data fields: ITEMNUMBER, ITEMNAME, QUANTITYAVAILABLE, and PRICE.

       <xsd:element name="ITEMNUMBER" type="xsd:int" ...>
       </xsd:element>
       <xsd:element name="ITEMNAME" type="xsd:string" ...>
       </xsd:element>
       <xsd:element name="QUANTITYAVAILABLE" type="xsd:int" ...>
       </xsd:element>
       <xsd:element name="PRICE" type="xsd:double" ...>
       </xsd:element>

The value of the name attribute should match one of the four values: ITEMNUMBER, ITEMNAME, QUANTITYAVAILABLE, or PRICE.

       <netui-data:basicColumn name="ITEMNUMBER" filterable="true" title="Itemnumber" sortable="true"/>
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

sortActionThe action method that will handle the sort operation.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

sortableBoolean. Determines whether or not the column is sortable.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

srcThe source of the image to display.
 
RequiredSupports runtime expression evaluationData bindable
NoNoRead Only

styleClassPrefix

The style class prefix used to make the style class name in the header, data, and footer cells. The styleClassPrefix will be concatinated with a suffix to create style class names that are rendered inside of the <td> tags for each cell in this column.

Assuming the value of this attribute is foo, the style class names rendered for each part of the column are shown in the table below.
Column RegionStyle class
Headerfoo-td-header
Datafoo-td-data
Footerfoo-td-footer

 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

titleThe text that will be rendered in the columns header.
 
RequiredSupports runtime expression evaluationData bindable
YesNoNo

widthInteger. The width of the image to be displayed in pixels.
 
RequiredSupports runtime expression evaluationData bindable
NoNoNo

Sample

This sample shows <netui-data:anchorColumn> tags used in a <netui:grid> tag.
         <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:basicColumn filterable="true" title="Itemname" sortable="true" name="itemname"/>
                 <netui-data:basicColumn filterable="true" title="Quantityavailable" sortable="true" name="quantityavailable"/>
                 <netui-data:basicColumn filterable="true" title="Price" sortable="true" name="price"/>
             </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