Label Class

com.bea.wlw.netui.tags.html
Label Class

public class Label

    extends AbstractBaseTag
    implements Formattable, IAttributeConsumer

Generates styled text span based on an expression or literal value.

Attribute Descriptions
AttributeRequiredRuntime Expression Evaluation Data Bindable
dataformatasNoNoNo
The data format of the Label
defaultValueNoNoRead Only
A literal default value that will be used when an expression results in a NULL value. If the default value is an expression, the any defined formatters will be applied to the default value. If the defaultValue is not an expression, the value will be output without applying formatters. If the default value is being output and contains a XML Entity, such as " ", then the default value is output without applying any escaping to it. The result default value acts like a literal string.
escapeWhiteSpaceForHtmlNoNoNo
Flag that will set an escape for white space. The default value is false.
idNoNoNo
The id attribute has been deprecated; instead, use tagId. The id of the span surrounding the Label text. You should use tagId which will encode the id correctly for containers such as the Portal which rewrite IDs to make them unique.
tagIdNoNoNo
The id of this label. The real id written to the HTML stream may be changed by the container (Portal), but may be looked up with the tagId value through the JavaScript method getNetuiTagName( tagId, tag ) method written by the <netui:html> tag.
valueYesNoRead Only
A literal value or an expression that resolves to a bean property.

If the resulting value to be output is the " " String, it will output as the value "&nbsp;".

Related Topics

<netui:label> Tag Sample
Content


Hierarchy
Object
  TagSupport
    BodyTagSupport
      AbstractBaseTag
        Label
All Implemented Interfaces

BodyTag, Formattable, IAttributeConsumer, IterationTag, Serializable, Tag

Field Summary

protected String
dataformatas
The data format of the Label.
protected String
value
The text of the Label.
   
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

Label()

 

Method Summary

public void
addFormatter(FormatTag.Formatter formatter)
Adds a FormatTag.Formatter to the Label's set of formatters
public int
doEndTag()
Render the label.
public int
doStartTag()
Prepare the label formatters.
public String
getDataformatas()
Gets the data formatters of the Label.
public String
getDefaultValue()
Return the default value of this Label.
public String
getId()
Return the ID of the label.
public String
getOnClick()
Gets the onClick javascript event.
public String
getOnDblClick()
Gets the onDblClick javascript event.
public String
getOnKeyDown()
Gets the onKeyDown javascript event.
public String
getOnKeyPress()
Gets the onKeyPress javascript event.
public String
getOnKeyUp()
Gets the onKeyUp javascript event.
public String
getOnMouseDown()
Gets the onMouseDown javascript event.
public String
getOnMouseMove()
Gets the onMouseMove javascript event.
public String
getOnMouseOut()
Gets the onMouseOut javascript event.
public String
getOnMouseOver()
Gets the onMouseOver javascript event.
public String
getOnMouseUp()
Gets the onMouseUp javascript event.
public String
getStyle()
Gets the style of the rendered html tag.
public String
getStyleClass()
Gets the style class of the rendered html tag.
public String
getTabindex()
Gets the tabIndex of the rendered html tag.
public String
getTagId()
Return the ID of the <span> that contains the label text.
public String
getTagName()
Return the name of the Tag.
public String
getValue()
Gets the text of the Label.
public boolean
isEscapeWhiteSpaceForHtml()
Gets the boolean value indicating if we are escaping the whitespace characters in HTML.
protected void
localRelease()
Release any acquired resources.
public void
setAttribute(String name, String value)
Set an attribute value.
public void
setDataformatas(String dataformatas)
Sets the data format of the Label.
public void
setDefaultValue(String defaultValue)
Set the default value of this Label.
public void
setEscapeWhiteSpaceForHtml(boolean escapeWhiteSpace)
Sets a boolean flag indicating if we will escape white space for HTML.
public void
setId(String id)
Set the ID of the label.
public void
setOnClick(String onclick)
Sets the onClick javascript event.
public void
setOnDblClick(String ondblclick)
Sets the onDblClick javascript event.
public void
setOnKeyDown(String onkeydown)
Sets the onKeyDown javascript event.
public void
setOnKeyPress(String onkeypress)
Sets the onKeyPress javascript event.
public void
setOnKeyUp(String onkeyup)
Sets the onKeyUp javascript event.
public void
setOnMouseDown(String onmousedown)
Sets the onMouseDown javascript event.
public void
setOnMouseMove(String onmousemove)
Sets the onMouseMove javascript event.
public void
setOnMouseOut(String onmouseout)
Sets the onMouseOut javascript event.
public void
setOnMouseOver(String onmouseover)
Sets the onMouseOver javascript event.
public void
setOnMouseUp(String onmouseup)
Sets the onMouseUp javascript event.
public void
setStyle(String style)
Sets the style of the rendered html tag.
public void
setStyleClass(String styleClass)
Sets the style class of the rendered html tag.
public void
setTabindex(String tabindex)
Sets the tabIndex of the rendered html tag.
public void
setTagId(String tagId)
Set the ID of the label.
public void
setValue(String value)
Sets the text of the Label.
 
Methods from  com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, evaluateAttributeToString, filter, getJavaScriptUtils, getNearestForm, getScriptReporter, getUserLocale, registerTagError, release, renderAttribute, rewriteName, write
 
Methods from  javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods from  javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, 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 com.bea.wlw.netui.tags.IAttributeConsumer
setAttribute
 
Methods from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
 
Methods from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent
 

Field Detail

dataformatas

protected String dataformatas
The data format of the Label.


value

protected String value
The text of the Label.

 

Constructor Detail

Label

public Label()
 

Method Detail

addFormatter(FormatTag.Formatter) Method

public void addFormatter(FormatTag.Formatter formatter)
Adds a FormatTag.Formatter to the Label's set of formatters

Parameters

formatter
- a FormatTag.Formatter added by a child FormatTag.

doEndTag() Method

public int doEndTag()
throws JspException
Render the label.

Overrides
BodyTagSupport.doEndTag()

Exceptions

JspException
if a JSP exception has occurred

doStartTag() Method

public int doStartTag()
throws JspException
Prepare the label formatters.

Overrides
BodyTagSupport.doStartTag()

Exceptions

JspException
if a JSP exception has occurred

getDataformatas() Method

public String getDataformatas()
Gets the data formatters of the Label.

Returns

the data format.

getDefaultValue() Method

public String getDefaultValue()
Return the default value of this Label.

Returns

the Label's default value

getId() Method

public String getId()
Return the ID of the label.

Overrides
TagSupport.getId()

Returns

the ID.

getOnClick() Method

public String getOnClick()
Gets the onClick javascript event.

Returns

the onClick event.

getOnDblClick() Method

public String getOnDblClick()
Gets the onDblClick javascript event.

Returns

the onDblClick event.

getOnKeyDown() Method

public String getOnKeyDown()
Gets the onKeyDown javascript event.

Returns

the onKeyDown event.

getOnKeyPress() Method

public String getOnKeyPress()
Gets the onKeyPress javascript event.

Returns

the onKeyPress event.

getOnKeyUp() Method

public String getOnKeyUp()
Gets the onKeyUp javascript event.

Returns

the onKeyUp event.

getOnMouseDown() Method

public String getOnMouseDown()
Gets the onMouseDown javascript event.

Returns

the onMouseDown event.

getOnMouseMove() Method

public String getOnMouseMove()
Gets the onMouseMove javascript event.

Returns

the onMouseMove event.

getOnMouseOut() Method

public String getOnMouseOut()
Gets the onMouseOut javascript event.

Returns

the onMouseOut event.

getOnMouseOver() Method

public String getOnMouseOver()
Gets the onMouseOver javascript event.

Returns

the onMouseOver event.

getOnMouseUp() Method

public String getOnMouseUp()
Gets the onMouseUp javascript event.

Returns

the onMouseUp event.

getStyle() Method

public String getStyle()
Gets the style of the rendered html tag.

Returns

the style.

getStyleClass() Method

public String getStyleClass()
Gets the style class of the rendered html tag.

Returns

the style class.

getTabindex() Method

public String getTabindex()
Gets the tabIndex of the rendered html tag.

Returns

the tabindex.

getTagId() Method

public String getTagId()
Return the ID of the <span> that contains the label text. The id may be rewritten by the container (such as a portal) to make sure it is unique. JavaScript my lookup the actual id of the element by looking it up in the netui_names table written into the HTML.

Returns

the ID.

getTagName() Method

public String getTagName()
Return the name of the Tag.

Overrides
AbstractBaseTag.getTagName()

getValue() Method

public String getValue()
Gets the text of the Label.

Returns

the text value

isEscapeWhiteSpaceForHtml() Method

public boolean isEscapeWhiteSpaceForHtml()
Gets the boolean value indicating if we are escaping the whitespace characters in HTML.

Returns

the state of white space handling

localRelease() Method

protected void localRelease()
Release any acquired resources.

Overrides
AbstractBaseTag.localRelease()

setAttribute(String, String) Method

public void setAttribute(String name, 
                         String value)
throws JspException
Set an attribute value. The name represents the name of the attribute. The value represents the value and may contain a netui expression. This method may result in errors being generated. This requires that the tag buffer its body and write attributes in the end tag. For the label tag it is not legal to set the id or name attributes with this method.

Parameters

name
The name of the attribute. This value may not be null or the empty string.
value
The value of the attribute. This may contain a netui expression.

Exceptions

JspException
A JspException may be thrown if there is an error setting the attribute.

setDataformatas(String) Method

public void setDataformatas(String dataformatas)
Sets the data format of the Label.

Parameters

dataformatas
- the data format.

setDefaultValue(String) Method

public void setDefaultValue(String defaultValue)
Set the default value of this Label. This can be an expression. If the default value is an expression all formatters will be applied, otherwise the default value will be output without being formatted.

Parameters

defaultValue
- the default value

setEscapeWhiteSpaceForHtml(boolean) Method

public void setEscapeWhiteSpaceForHtml(boolean escapeWhiteSpace)
Sets a boolean flag indicating if we will escape white space for HTML. If this is true the white space charcters ' ' will be converted into " " and '\n' converted into "
". The result is that in HTML white space will be represented correctly. If this is false then white space will be output as it is found in the value.

Parameters

escapeWhiteSpace
- boolean indicating if we are escaping for white space.

setId(String) Method

public void setId(String id)
Set the ID of the label.

Overrides
TagSupport.setId(String)

Parameters

id
- the ID.

setOnClick(String) Method

public void setOnClick(String onclick)
Sets the onClick javascript event.

Parameters

onclick
- the onClick event.

setOnDblClick(String) Method

public void setOnDblClick(String ondblclick)
Sets the onDblClick javascript event.

Parameters

ondblclick
- the onDblClick event.

setOnKeyDown(String) Method

public void setOnKeyDown(String onkeydown)
Sets the onKeyDown javascript event.

Parameters

onkeydown
- the onKeyDown event.

setOnKeyPress(String) Method

public void setOnKeyPress(String onkeypress)
Sets the onKeyPress javascript event.

Parameters

onkeypress
- the onKeyPress event.

setOnKeyUp(String) Method

public void setOnKeyUp(String onkeyup)
Sets the onKeyUp javascript event.

Parameters

onkeyup
- the onKeyUp event.

setOnMouseDown(String) Method

public void setOnMouseDown(String onmousedown)
Sets the onMouseDown javascript event.

Parameters

onmousedown
- the onMouseDown event.

setOnMouseMove(String) Method

public void setOnMouseMove(String onmousemove)
Sets the onMouseMove javascript event.

Parameters

onmousemove
- the onMouseMove event.

setOnMouseOut(String) Method

public void setOnMouseOut(String onmouseout)
Sets the onMouseOut javascript event.

Parameters

onmouseout
- the onMouseOut event.

setOnMouseOver(String) Method

public void setOnMouseOver(String onmouseover)
Sets the onMouseOver javascript event.

Parameters

onmouseover
- the onMouseOver event.

setOnMouseUp(String) Method

public void setOnMouseUp(String onmouseup)
Sets the onMouseUp javascript event.

Parameters

onmouseup
- the onMouseUp event.

setStyle(String) Method

public void setStyle(String style)
Sets the style of the rendered html tag.

Parameters

style
- the html style.

setStyleClass(String) Method

public void setStyleClass(String styleClass)
Sets the style class of the rendered html tag.

Parameters

styleClass
- the html style class.

setTabindex(String) Method

public void setTabindex(String tabindex)
Sets the tabIndex of the rendered html tag.

Parameters

tabindex
- the tab index.

setTagId(String) Method

public void setTagId(String tagId)
Set the ID of the label.

Parameters

tagId
- the ID.

setValue(String) Method

public void setValue(String value)
Sets the text of the Label.

Parameters

value
- the Label value or expression.