|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport javax.servlet.jsp.tagext.BodyTagSupport com.bea.wlw.netui.tags.AbstractBaseTag com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag com.bea.wlw.netui.tags.databinding.grid.GridComponent com.bea.wlw.netui.tags.databinding.grid.column.GridColumn com.bea.wlw.netui.tags.databinding.grid.column.FormattableColumn com.bea.wlw.netui.tags.databinding.grid.column.SortFilterColumn com.bea.wlw.netui.tags.databinding.grid.column.ImageColumn com.bea.wlw.netui.tags.databinding.grid.column.AnchorColumn
public class AnchorColumn
A column that renders an HTML anchor into each data cell in the column.
The anchor that is created is constructed from attributes on this tag
and any nested Parameter
or ParameterMap
tags; this GridColumn implements the URLParams
interface.
The anchor can be constructed in one of two ways -- using text provided
in the title attribute or 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 AnchorColumn has the ability to render an image inside the anchor, resulting
in the image being clickable. This can be accomplished by setting
the src
attribute and other attributes that are available
on the ImageColumn
tag. 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 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 AnchorColumn.
The Page Flow Wizard adds the _grid.js file to a project's
/resources/grid directory, when you build a page flow over a database control.
The JSP should contain:
<script language="javascript" src="/resources/grid/_grid.js" type="text/javascript"></script> |
Attribute Descriptions | |||
---|---|---|---|
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
action | No | No | No |
The action that should be part of the HTML anchor that is rendered in this column. | |||
addRowId | No | Yes | No |
A boolean that denotes that the unique identifier for this row, if one is available, will be rendered onto the generated HTML anchor. | |||
alt | No | Yes | No |
The alternate text displayed in the browser if the image cannot be displayed. | |||
border | No | Yes | No |
The number of pixels to display in a border around this image. The default border is zero. | |||
filterable | No | Yes | No |
A boolean specifying whether the anchors can be filtered. | |||
filterAction | No | Yes | No |
The name of the action that will perform the filter operation. | |||
href | No | Yes | No |
The web addressable resource that will be part of the HTML anchor that is rendered in this column. | |||
name | No | Yes | Yes |
If specified, the value of the data is extracted from the Grid's
current data item. Otherwise, the title attribute is used for the cell's
content. | |||
sortable | No | Yes | No |
A boolean specifying whether the anchor column's contents can be sorted. | |||
sortAction | No | Yes | No |
The name of the action that will perform the sort operation. | |||
title | No | No | No |
The text that will be rendered in the header for this column. |
<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>
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 Parameter
or 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> |
Field Summary |
---|
Fields inherited from class com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag |
---|
EMPTY_STRING |
Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag |
---|
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT |
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface com.bea.wlw.netui.tags.html.HtmlConstants |
---|
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
AnchorColumn()
|
Method Summary | |
---|---|
void |
addParameter(String name,
Object value)
This method allows the key / value pairs that will be written onto the URL to be added to the anchor that is rendered for each cell in the column that is rendered for an item in the dataset. |
String |
getAction()
Get the action that is rendered in the anchor of this column. |
boolean |
getAddRowId()
Get the boolean for whether this tag will encode a record's unique identifier into the URL. |
String |
getHref()
Get the href that is rendered in the anchor of this column. |
String |
getTagName()
Get the name of this tag. |
String |
getTarget()
Returns the window target. |
protected void |
localRelease()
Reset all of the fields of this tag. |
protected void |
prepare()
Perform initialization for this tag. |
String |
renderDataCell()
Render the contents of this AnchorColumn
for the current data item from the containing Grid tag. |
String |
renderFooterCell()
Render the footer. |
protected int |
renderStartTag(int gridState)
This tag only evaluates its body when the grid is rendering its ROWS . |
void |
setAction(String action)
Set the action that is rendered in the anchor of this column. |
void |
setAddRowId(boolean addRowId)
Set a boolean that, if true , will encode the record's
unique identifier, often the primary key, onto each anchor's URL
link. |
void |
setHref(String href)
Set the href that is rendered in the anchor of this column. |
void |
setTarget(String target)
Sets the window target. |
protected void |
verifyAttributes()
Verify the attributes on this tag. |
Methods inherited from class com.bea.wlw.netui.tags.databinding.grid.column.ImageColumn |
---|
getAlt, getBorder, getHeight, getSrc, getWidth, renderImage, setAlt, setBorder, setHeight, setSrc, setWidth |
Methods inherited from class com.bea.wlw.netui.tags.databinding.grid.column.SortFilterColumn |
---|
calculateURL, canFilter, canSort, computeFilterAction, computeSortAction, getFilterAction, getName, getSortAction, getTitle, getTitleText, isFilterable, isSortable, renderFilterMarkup, renderHeaderCell, renderSortMarkup, setFilterable, setFilterAction, setName, setSortable, setSortAction, setTitle |
Methods inherited from class com.bea.wlw.netui.tags.databinding.grid.column.FormattableColumn |
---|
addFormatter, format |
Methods inherited from class com.bea.wlw.netui.tags.databinding.grid.column.GridColumn |
---|
getColumns, getStyleClassPrefix, getValidContainerType, renderCloseCellTag, renderDataCellTag, renderEndTag, renderFooterCellTag, renderHeaderCellTag, renderOpenCellTag, setStyleClassPrefix |
Methods inherited from class com.bea.wlw.netui.tags.databinding.grid.GridComponent |
---|
getCurrentRenderState, getGrid, getGridContext |
Methods inherited from class com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag |
---|
addContent, doEndTag, doStartTag, getContent, verifyStructure |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
getParent, setParent |
Constructor Detail |
---|
public AnchorColumn()
Method Detail |
---|
public void setAddRowId(boolean addRowId)
true
, will encode the record's
unique identifier, often the primary key, onto each anchor's URL
link.
addRowId
- a boolean that will encode the unique identifier if true
public boolean getAddRowId()
true
if the unique identifier will be encoded; false
otherwise.public void setHref(String href)
href
- the href to render in the HTML anchor tag.public String getHref()
null
public void setAction(String action)
PageFlowController
as an action must be defined in order to render the href attrubite on
the resulting anchor.
action
- the name of the action from a PageFlowPageFlows
public String getAction()
null
public String getTagName()
getTagName
in class ImageColumn
public String renderDataCell() throws javax.servlet.jsp.JspException
AnchorColumn
for the current data item from the containing Grid tag. An AnchorColumn
uses either the href or the action attribute to render an HTML anchor
into each data cell in the column. If a name attribute is specified,
the value of the data is extracted from the Grid's current data item.
Otherwise, the title attribute is used for the cell's content.
renderDataCell
in class ImageColumn
javax.servlet.jsp.JspException
- if an error occurred that can not be reported in the pagepublic String renderFooterCell()
renderFooterCell
in class ImageColumn
protected void localRelease()
localRelease
in class ImageColumn
public void addParameter(String name, Object value)
addParameter
in interface URLParams
URLParams tag
,
Parameter tag
,
ParameterMap tag
protected int renderStartTag(int gridState)
ROWS
.
renderStartTag
in class ImageColumn
gridState
- the state of this column's Grid tag parent
protected void prepare()
prepare
in class ImageColumn
protected void verifyAttributes() throws javax.servlet.jsp.JspException
verifyAttributes
in class ImageColumn
javax.servlet.jsp.JspException
- if an error occurs that can not be reported in the pagepublic String getTarget()
public void setTarget(String target)
target
- - the window target.
|
BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |