ImageColumn Class

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

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.

Related Topics

BinaryFlow Sample
Grid


Hierarchy
Object
  TagSupport
    BodyTagSupport
      AbstractBaseTag
        StructuredBaseTag
          GridComponent
            GridColumn
              FormattableColumn
                SortFilterColumn
                  ImageColumn
All Implemented Interfaces

BodyTag, Formattable, IterationTag, Serializable, Tag
Direct Known Subclasses

AnchorColumn

Field Summary

   
Fields from  com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
EMPTY_STRING
 
Fields from  com.bea.wlw.netui.tags.AbstractBaseTag
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, CLASS, ID, JAVASCRIPT_STATUS, NAME, NETUI_UNIQUE_CNT, ONCLICK, ONDBLCLICK, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, STYLE, TABINDEX
 
Fields from  javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields from  javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 

Constructor Summary

ImageColumn()

 

Method Summary

public String
getAlt()
Get the alternate text for the image.
public int
getBorder()
Get the width in pixels of the border to draw around the image.
public String
getHeight()
Get the height of the image.
public String
getSrc()
Get the source of the image to display.
public String
getTagName()
Get the name of this tag.
public 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.
public String
renderDataCell()
Render the contents of this GridColumn for each dataset item into each cell in the column.
public 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.
public void
setAlt(String alt)
Set the alternate text displayed in the browser if the image can't be displayed.
public void
setBorder(int border)
Set an int representing the width of the border to draw around the image.
public void
setHeight(String height)
Set the height of the image to be displayed in pixels.
public void
setSrc(String src)
Set the source of the image to display.
public 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 from  com.bea.wlw.netui.tags.databinding.grid.column.SortFilterColumn
canFilter, canSort, computeFilterAction, computeSortAction, getFilterAction, getName, getSortAction, getTitle, getTitleText, isFilterable, isSortable, renderHeaderCell, setFilterable, setFilterAction, setName, setSortable, setSortAction, setTitle,
 
Methods from  com.bea.wlw.netui.tags.databinding.grid.column.FormattableColumn
addFormatter, format, localRelease,
 
Methods from  com.bea.wlw.netui.tags.databinding.grid.column.GridColumn
getColumns, getStyleClassPrefix, getValidContainerType, localRelease, prepare, renderCloseCellTag, renderDataCellTag, renderEndTag, renderFooterCellTag, renderHeaderCell, renderHeaderCellTag, renderOpenCellTag, renderStartTag, setStyleClassPrefix
 
Methods from  com.bea.wlw.netui.tags.databinding.grid.GridComponent
getCurrentRenderState, getGrid, getGridContext, getValidContainerType, localRelease, prepare
 
Methods from  com.bea.wlw.netui.tags.databinding.base.StructuredBaseTag
addContent, doEndTag, doStartTag, getContent, getCurrentRenderState, getValidContainerType, localRelease, prepare, renderEndTag, renderStartTag, verifyAttributes, verifyStructure
 
Methods from  com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, evaluateAttributeToString, filter, filter, getJavaScriptUtils, getNearestForm, getScriptReporter, getUserLocale, localRelease, registerTagError, release, renderAttribute, rewriteName, write
 
Methods from  javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods from  javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface javax.servlet.jsp.tagext.BodyTag
doInitBody, setBodyContent
 
Methods from interface com.bea.wlw.netui.tags.html.Formattable
addFormatter
 
Methods from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
 
Methods from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent
 

Constructor Detail

ImageColumn

public ImageColumn()
 

Method Detail

getAlt() Method

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

Returns

the alternate text

getBorder() Method

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.

getHeight() Method

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

Returns

the fixed height of the image

getSrc() Method

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

Returns

the source of an image

getTagName() Method

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

Overrides
AbstractBaseTag.getTagName()

Returns

a constant String representing the name of this tag.

getWidth() Method

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

Returns

the fixed width of the image

localRelease() Method

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

Overrides
SortFilterColumn.localRelease()

prepare() Method

protected void prepare()
Perform initialization for this tag.

Overrides
SortFilterColumn.prepare()

renderDataCell() Method

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

Overrides
GridColumn.renderDataCell()

Exceptions

JspException
if an error occurred that can not be reported in the page

renderFooterCell() Method

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

Overrides
GridColumn.renderFooterCell()

Returns

the emtpy string

renderImage() Method

protected String renderImage()
throws JspException

Exceptions

JspException

renderStartTag(int) Method

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

Overrides
FormattableColumn.renderStartTag(int)

Parameters

gridState
the state of this column's Grid tag parent

Returns

EVAL_BODY_BUFFERED

setAlt(String) Method

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

setBorder(int) Method

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

setHeight(String) Method

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

Parameters

height
the fixed height of the image

setSrc(String) Method

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

Parameters

src
the source of an image

setWidth(String) Method

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

Parameters

width
the fixed width of the image

verifyAttributes() Method

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

Overrides
SortFilterColumn.verifyAttributes()

Exceptions

JspException
if an error occurs that can not be reported in the page