This tag renders a column with an HTML hyperlink in each data cell.
<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"] />
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> |
<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>