|
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.html.Label
public class Label
Generates styled text span based on an expression or literal value.
Attribute Descriptions | |||
---|---|---|---|
Attribute | Required | Runtime Expression Evaluation | Data Bindable |
dataformatas | No | No | No |
The data format of the Label | |||
defaultValue | No | No | Read 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. | |||
escapeWhiteSpaceForHtml | No | No | No |
Flag that will set an escape for white space. The default value is false. | |||
id | No | No | No |
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. | |||
tagId | No | No | No |
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. | |||
value | Yes | No | Read Only |
A literal value or an expression that resolves to a bean property. |
If the resulting value to be output is the " "
Content
,
Serialized Form<netui:label value="{actionForm.firstName}" />
In this next sample, the value
attribute will resolve to null.
This causes the defaultValue
to be displayed. The user will see ' '.
<netui:label value="{pageFlow.somethingNull}" defaultValue=" "/>
In this next sample, the HTML will contain the text "&nbsp;" and the user will see ' '
<netui:label value="{pageFlow.somethingNull}" defaultValue="&nbsp;"/>
Generates styled text based on a String literal or data binding expression.
The <netui:label> tag is similar to the Content
tag,
except with respect to the way that it treats
characters sensitive to HTML browsers.
The <netui:label> tag filters the input string for browser-sensitive characters
and replaces these characters
with the corresponding entity strings. For example, if you pass the
string '&' to a <netui:label> tag, the string '&amp;' will be written to
the HTML source file, and the following will be displayed
in the browser: '&'.
The following table shows how the <netui:label> and <netui:content> tags treat HTML-sensitive characters.
tag generated HTML source displayed in browser <netui:content value="&"/> & & <netui:label value="&"/> &amp; &
Note: escaping is not applied to browser-sensitive characters in
the defaultValue
attribute.
Field Summary | |
---|---|
protected String |
dataformatas
The data format of the Label. |
protected ArrayList |
formatters
|
protected Object |
labelObject
|
protected String |
value
The text of the Label. |
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 |
---|
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 | |
---|---|
Label()
|
Method Summary | |
---|---|
void |
addFormatter(FormatTag.Formatter formatter)
Adds a FormatTag.Formatter to the Label's set of formatters |
int |
doEndTag()
Render the label. |
int |
doStartTag()
Prepare the label formatters. |
protected String |
filter(String value,
boolean markupHTMLSpaceReturn)
Filter the specified string for characters that are senstive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities. |
protected String |
formatText(Object text)
|
String |
getDataformatas()
Gets the data formatters of the Label. |
String |
getDefaultValue()
Return the default value of this Label. |
String |
getId()
Return the ID of the label. |
String |
getOnClick()
Gets the onClick javascript event. |
String |
getOnDblClick()
Gets the onDblClick javascript event. |
String |
getOnKeyDown()
Gets the onKeyDown javascript event. |
String |
getOnKeyPress()
Gets the onKeyPress javascript event. |
String |
getOnKeyUp()
Gets the onKeyUp javascript event. |
String |
getOnMouseDown()
Gets the onMouseDown javascript event. |
String |
getOnMouseMove()
Gets the onMouseMove javascript event. |
String |
getOnMouseOut()
Gets the onMouseOut javascript event. |
String |
getOnMouseOver()
Gets the onMouseOver javascript event. |
String |
getOnMouseUp()
Gets the onMouseUp javascript event. |
protected AbstractHtmlState |
getState()
This method will return the state associated with the tag. |
String |
getStyle()
Gets the style of the rendered html tag. |
String |
getStyleClass()
Gets the style class of the rendered html tag. |
String |
getTabindex()
Gets the tabIndex of the rendered html tag. |
String |
getTagId()
Return the ID of the <span> that contains the label text. |
String |
getTagName()
Return the name of the Tag. |
String |
getValue()
Gets the text of the Label. |
boolean |
isEscapeWhiteSpaceForHtml()
Gets the boolean value indicating if we are escaping
the whitespace characters in HTML. |
protected void |
localRelease()
Release any acquired resources. |
void |
setAttribute(String name,
String value)
Set an attribute value. |
void |
setDataformatas(String dataformatas)
Sets the data format of the Label. |
void |
setDefaultValue(String defaultValue)
Set the default value of this Label. |
void |
setEscapeWhiteSpaceForHtml(boolean escapeWhiteSpace)
Sets a boolean flag indicating if we will escape
white space for HTML. |
void |
setId(String id)
Set the ID of the label. |
void |
setOnClick(String onclick)
Sets the onClick javascript event. |
void |
setOnDblClick(String ondblclick)
Sets the onDblClick javascript event. |
void |
setOnKeyDown(String onkeydown)
Sets the onKeyDown javascript event. |
void |
setOnKeyPress(String onkeypress)
Sets the onKeyPress javascript event. |
void |
setOnKeyUp(String onkeyup)
Sets the onKeyUp javascript event. |
void |
setOnMouseDown(String onmousedown)
Sets the onMouseDown javascript event. |
void |
setOnMouseMove(String onmousemove)
Sets the onMouseMove javascript event. |
void |
setOnMouseOut(String onmouseout)
Sets the onMouseOut javascript event. |
void |
setOnMouseOver(String onmouseover)
Sets the onMouseOver javascript event. |
void |
setOnMouseUp(String onmouseup)
Sets the onMouseUp javascript event. |
void |
setStyle(String style)
Sets the style of the rendered html tag. |
void |
setStyleClass(String styleClass)
Sets the style class of the rendered html tag. |
void |
setTabindex(String tabindex)
Sets the tabIndex of the rendered html tag. |
void |
setTagId(String tagId)
Set the ID of the label. |
void |
setValue(String value)
Sets the text of the Label. |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
---|
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
findAncestorWithClass, getParent, getValue, getValues, removeValue, 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 |
Field Detail |
---|
protected ArrayList formatters
protected String dataformatas
protected Object labelObject
protected String value
Constructor Detail |
---|
public Label()
Method Detail |
---|
public String getTagName()
getTagName
in class AbstractBaseTag
protected AbstractHtmlState getState()
AbstractHtmlState
class.public void setAttribute(String name, String value) throws javax.servlet.jsp.JspException
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.
setAttribute
in interface IAttributeConsumer
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.
javax.servlet.jsp.JspException
- A JspException may be thrown if there is an error setting the attribute.public void setDataformatas(String dataformatas)
dataformatas
- - the data format.public String getDataformatas()
public String getDefaultValue()
public void setDefaultValue(String defaultValue)
defaultValue
- - the default valuevalue
attribute resolves to NULL.
If the defaultValue
is an expression, then any
format tags (<netui:formatString>, etc.) will be applied to the value.
If the defaultValue
is not an expression,
format tags will not be applied.
If the defaultValue
contains an entity string, such as " ",
then the default value is output without applying any escaping to it.public String getId()
getId
in class javax.servlet.jsp.tagext.TagSupport
public void setId(String id)
setId
in class javax.servlet.jsp.tagext.TagSupport
id
- - the ID.public String getTagId()
<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.
public void setTagId(String tagId)
tagId
- - the ID.String value. Sets the id
(or name
) attribute of the rendered HTML tag.
Note that the real id attribute rendered in the browser may be
changed by the application container (for example, Portal containers may change
the rendered id value to ensure the uniqueness of
id's on the page). In this case, the real id rendered
in the browser may be looked up
through the JavaScript function getNetuiTagName( tagId, tag ).
For example, assume that some tag's tagId
attribute is set to foo
.
<netui:textBox tagId="foo" />
Then the following JavaScript function will return the real id attribute rendered in the browser:
getNetuiTagName( "foo", this )
To get a <netui:form> element and all of its children elements in JavaScript, use
the same JavaScript function getNetuiTagName( tagId, tag )
. For example,
assume that there is a <netui:form> whose
tagId attribute is set to bar
.
<netui:form tagId="bar" >
Then the following JavaScript function will return the <netui:form> element and its children (packaged as an array).
document[getNetuiTagName( "bar", this )]
To retreive the value entered into a <netui:textBox> within the <netui:form> tag, use the following JavaScript expression.
document[getNetuiTagName("bar", this)][getNetuiTagName("foo", this)].value
The second parameter ensures that the JavaScript function
begins its search within the correct Portlet scope. Pass the
JavaScript keyword this
as the second parameter.
For detailed information on using the function
getNetuiTagName( tagId, tag )
see
Using JavaScript in Page Flow and Portal Applications.
public void setValue(String value)
value
- - the Label value or expression.public String getValue()
public void setEscapeWhiteSpaceForHtml(boolean escapeWhiteSpace)
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
"false
then white space will be
output as it is found in the value.
escapeWhiteSpace
- - boolean indicating if we are escaping for white space.public boolean isEscapeWhiteSpaceForHtml()
boolean
value indicating if we are escaping
the whitespace characters in HTML.
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredpublic int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.BodyTagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredprotected void localRelease()
localRelease
in class AbstractBaseTag
public void addFormatter(FormatTag.Formatter formatter)
addFormatter
in interface Formattable
formatter
- - a FormatTag.Formatter added by a child FormatTag.protected String formatText(Object text)
protected String filter(String value, boolean markupHTMLSpaceReturn)
filter
in class AbstractBaseTag
value
- The string to be filtered and returnedmarkupHTMLSpaceReturn
- convert space characters and return characters
to and <br /> marketup for html.public void setTabindex(String tabindex)
tabindex
- - the tab index.public String getTabindex()
public void setStyle(String style)
style
- - the html style.public String getStyle()
public void setStyleClass(String styleClass)
styleClass
- - the html style class.public String getStyleClass()
public String getOnClick()
public void setOnClick(String onclick)
onclick
- - the onClick event.public String getOnDblClick()
public void setOnDblClick(String ondblclick)
ondblclick
- - the onDblClick event.public String getOnKeyDown()
public void setOnKeyDown(String onkeydown)
onkeydown
- - the onKeyDown event.public String getOnKeyPress()
public void setOnKeyPress(String onkeypress)
onkeypress
- - the onKeyPress event.public String getOnKeyUp()
public void setOnKeyUp(String onkeyup)
onkeyup
- - the onKeyUp event.public String getOnMouseDown()
public void setOnMouseDown(String onmousedown)
onmousedown
- - the onMouseDown event.public String getOnMouseMove()
public void setOnMouseMove(String onmousemove)
onmousemove
- - the onMouseMove event.public String getOnMouseOut()
public void setOnMouseOut(String onmouseout)
onmouseout
- - the onMouseOut event.public String getOnMouseOver()
public void setOnMouseOver(String onmouseover)
onmouseover
- - the onMouseOver event.public String getOnMouseUp()
public void setOnMouseUp(String onmouseup)
onmouseup
- - the onMouseUp event.
|
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 |