BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.

com.bea.wlw.netui.tags.databinding.grid.column
Class ImageColumn

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.bea.wlw.netui.tags.AbstractBaseTag
              extended by com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
                  extended by com.bea.wlw.netui.tags.databinding.grid.GridComponent
                      extended by com.bea.wlw.netui.tags.databinding.grid.column.GridColumn
                          extended by com.bea.wlw.netui.tags.databinding.grid.column.FormattableColumn
                              extended by com.bea.wlw.netui.tags.databinding.grid.column.SortFilterColumn
                                  extended by com.bea.wlw.netui.tags.databinding.grid.column.ImageColumn
All Implemented Interfaces:
Formattable, HtmlConstants, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
AnchorColumn

public class ImageColumn
extends SortFilterColumn

A column that renders an image in HTML into each data cell in a column. The image that is rendered is specified with the src attribute and can be further parameterized with attributes to constrain its width, height, alternate text, and border. If the height and width attributes are not specified, the image is rendered at its actual size.

Required resources:

The JavaScript file _grid.js must be included in any JSP page with a grid that uses a filter-enabled ImageColumn. 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
AttributeRequiredRuntime Expression EvaluationData Bindable
altNoYesNo
The alternate text displayed in the browser if the image cannot be displayed.
borderNoYesNo
The number of pixels to display in a border around this image. The default border is zero.
heightNoYesYes
The height of the image. If you omit the height and width attributes, the graphic's actual size will be used.
srcYesYesYes
The source of the image to display.
widthNoYesYes
The width of the image. If you omit the height and width attributes, the graphic's actual size will be used.

See Also:
Grid, Serialized Form
Example:
In this sample, a <netui-data:imageColumn> tag is nested within Grid and Columns tags to present a column that contains a different image in each cell.
 ...
 <netui:grid>
     <netui:columns>
        ...
          <netui-data:imageColumn title="Sale Items" border="1" alt="Sale Items"
                                  src="/resources/images/{container.item.image}"/>
     </netui:columns>
 </netui:grid>
 

Code Sample

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/binaryFlow/grid.jsp
Beadoc.see:
BinaryFlow Sample
Beadoc.tagdescription:

This tag renders an image into each data cell in a column. The image that is rendered is specified with the src attribute and can be further parameterized with attributes to constrain its width, height, alternate text, and border. If the height and width attributes are not specified, the image is rendered at its actual size.


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
ImageColumn()
           
 
Method Summary
 String getAlt()
          Get the alternate text for the image.
 int getBorder()
          Get the width in pixels of the border to draw around the image.
 String getHeight()
          Get the height of the image.
 String getSrc()
          Get the source of the image to display.
 String getTagName()
          Get the name of this tag.
 String getWidth()
          Get the width of the image.
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 GridColumn for each dataset item into each cell in the column.
 String renderFooterCell()
          Render the footer.
protected  String renderImage()
           
protected  int renderStartTag(int gridState)
          This tag only evaluates its body when the grid is rendering its ROWS.
 void setAlt(String alt)
          Set the alternate text displayed in the browser if the image can't be displayed.
 void setBorder(int border)
          Set an int representing the width of the border to draw around the image.
 void setHeight(String height)
          Set the height of the image to be displayed in pixels.
 void setSrc(String src)
          Set the source of the image to display.
 void setWidth(String width)
          Set the width of the image to be displayed in pixels.
protected  void verifyAttributes()
          Ensure that the attributes set on the tag are valid.
 
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 com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, containsExpression, evaluateAttributeToString, evaluateExpression, filter, filter, formatErrorString, formatString, getAttribute, getErrorsReport, getExpressionEvaluator, getJavaScriptUtils, getNearestForm, getNextId, getQualifiedBundleName, getScriptReporter, getUserLocale, hasErrors, isExpression, prepForRendering, registerAttribute, registerError, registerTagError, release, removeAttribute, renderAttribute, renderAttributes, reportErrors, rewriteName, setPageContext, updateExpression, write
 
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

ImageColumn

public ImageColumn()
Method Detail

setAlt

public void setAlt(String alt)
Set the alternate text displayed in the browser if the image can't be displayed.

Parameters:
alt - the alternate text
Beadoc.attributedescription:
The alternate text to display in the browser if the image can not be displayed.
Beadoc.attributesyntaxvalue:
string_alt
Beadoc.databindable:
false

getAlt

public String getAlt()
Get the alternate text for the image.

Returns:
the alternate text

setBorder

public void setBorder(int border)
Set an int representing the width of the border to draw around the image.

Parameters:
border - boolean for image border drawing
Beadoc.attributedescription:
Integer. The width of the border around the image.
Beadoc.attributesyntaxvalue:
integer_border
Beadoc.databindable:
false

getBorder

public int getBorder()
Get the width in pixels of the border to draw around the image.

Returns:
the pixel width int; the default is zero.

setWidth

public void setWidth(String width)
Set the width of the image to be displayed in pixels.

Parameters:
width - the fixed width of the image
Beadoc.attributedescription:
Integer. The width of the image to be displayed in pixels.
Beadoc.attributesyntaxvalue:
integer_width
Beadoc.databindable:
false

getWidth

public String getWidth()
Get the width of the image.

Returns:
the fixed width of the image

setHeight

public void setHeight(String height)
Set the height of the image to be displayed in pixels.

Parameters:
height - the fixed height of the image
Beadoc.attributedescription:
Integer. The height of the image to be displayed in pixels.
Beadoc.attributesyntaxvalue:
integer_height
Beadoc.databindable:
false

getHeight

public String getHeight()
Get the height of the image.

Returns:
the fixed height of the image

setSrc

public void setSrc(String src)
Set the source of the image to display.

Parameters:
src - the source of an image
Beadoc.attributedescription:
The source of the image to display.
Beadoc.attributesyntaxvalue:
literal_or_expression_src
Beadoc.databindable:
Read Only

getSrc

public String getSrc()
Get the source of the image to display.

Returns:
the source of an image

getTagName

public String getTagName()
Get the name of this tag. This is used to identify the type of this tag for reporting tag errors.

Specified by:
getTagName in class AbstractBaseTag
Returns:
a constant String representing the name of this tag.

renderDataCell

public String renderDataCell()
                      throws javax.servlet.jsp.JspException
Description copied from class: GridColumn
Render the contents of this GridColumn for each dataset item into each cell in the column.

Specified by:
renderDataCell in class GridColumn
Throws:
javax.servlet.jsp.JspException - if an error occurred that can not be reported in the page

renderImage

protected String renderImage()
                      throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException

renderFooterCell

public String renderFooterCell()
Render the footer. This footer contains no text.

Specified by:
renderFooterCell in class GridColumn
Returns:
the emtpy string

localRelease

protected void localRelease()
Reset all of the fields of this tag.

Overrides:
localRelease in class SortFilterColumn

renderStartTag

protected int renderStartTag(int gridState)
This tag only evaluates its body when the grid is rendering its ROWS.

Overrides:
renderStartTag in class FormattableColumn
Parameters:
gridState - the state of this column's Grid tag parent
Returns:
EVAL_BODY_BUFFERED

prepare

protected void prepare()
Perform initialization for this tag.

Overrides:
prepare in class SortFilterColumn

verifyAttributes

protected void verifyAttributes()
                         throws javax.servlet.jsp.JspException
Description copied from class: SortFilterColumn
Ensure that the attributes set on the tag are valid. The requirements are:

Overrides:
verifyAttributes in class SortFilterColumn
Throws:
javax.servlet.jsp.JspException - if an error occurs that can not be reported in the page

BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.