NetUI Tag Library Documentation (Version 1.0.1)

netui
netui:span Tag

Generates styled text based on a String literal or data binding expression.

Syntax

<netui:span
    [defaultValue="string_or_expression_defaultValue"]
    [dir="string_dir"]
    [escapeWhiteSpaceForHtml="boolean_escapeWhiteSpace"]
    [formatDefaultValue="boolean_formatDisplay"]
    [lang="string_lang"]
    [onClick="string_onClick"]
    [onDblClick="string_onDblClick"]
    [onKeyDown="string_onKeyDown"]
    [onKeyPress="string_onKeyPress"]
    [onKeyUp="string_onKeyUp"]
    [onMouseDown="string_onMouseDown"]
    [onMouseMove="string_onMouseMove"]
    [onMouseOut="string_onMouseOut"]
    [onMouseOver="string_onMouseOver"]
    [onMouseUp="string_onMouseUp"]
    [style="string_style"]
    [styleClass="string_styleClass"]
    [tagId="string_tagId"]
    [title="string_title"]
    value="string_or_expression_output" >
    ... JSP content ...
</netui:span>

Description

Generates styled text based on a String literal or data binding expression.

The <netui:span> tag is similar to the <netui:content> tag, except with respect to the way that it treats characters sensitive to HTML browsers. The <netui:span> 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 '&amp;' to a <netui:span> tag, the string '&amp;amp;' will be written to the HTML source file, and the following will be displayed in the browser: '&amp;'.

The following table shows how the <netui:span> and <netui:content> tags treat HTML-sensitive characters.

tag generated HTML source displayed in browser
<netui:content value="&amp;"/> &amp; &
<netui:span value="&amp;"/> &amp;amp; &amp;

Note: escaping is not applied to browser-sensitive characters in the defaultValue attribute.

Attributes
defaultValue
Required: No  |   Type: Object  |   Supports runtime evaluation / JSP Expression Language: Yes

The String literal or expression to be used as the default output. If the default value is an expression all formatters will be applied, otherwise the default value will be output without being formatted.
dir
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Specifies the direction of text. (LTR | RTL)
escapeWhiteSpaceForHtml
Required: No  |   Type: boolean  |   Supports runtime evaluation / JSP Expression Language: Yes

Sets a boolean flag indicating if we will escape white space for HTML.
formatDefaultValue
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Boolean indicating whether the formatter should be applied to the defaultValue. The default is "false" meaning formatters will not be applied.
lang
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Sets the language code for the base language of an element's attribute values and text content.
onClick
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The onClick JavaScript event.
onDblClick
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The onDblClick JavaScript event.
onKeyDown
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The onKeyDown JavaScript event.
onKeyPress
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The onKeyPress JavaScript event.
onKeyUp
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The onKeyUp JavaScript event.
onMouseDown
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The onMouseDown JavaScript event.
onMouseMove
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The onMouseMove JavaScript event.
onMouseOut
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The onMouseOut JavaScript event.
onMouseOver
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The onMouseOver JavaScript event.
onMouseUp
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The onMouseUp JavaScript event.
style
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

Specifies style information for the current element.
styleClass
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The style class (a style sheet selector).
tagId
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

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 lookupIdByTagId( 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:

    lookupIdByTagId( "foo", this )

To get a <netui:form> element and all of its children elements in JavaScript, use the same JavaScript function lookupIdByTagId( 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[lookupIdByTagId( "bar", this )]

To retreive the value entered into a <netui:textBox> within the <netui:form> tag, use the following JavaScript expression.

    document[lookupIdByTagId("bar", this)][lookupIdByTagId("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.

title
Required: No  |   Type: String  |   Supports runtime evaluation / JSP Expression Language: Yes

The title.
value
Required: Yes  |   Type: Object  |   Supports runtime evaluation / JSP Expression Language: Yes

The String literal or expression used as the text of the Label.

Example

In this first sample, a <netui:span> tag displays the Form Bean's firstName property. The <netui:span> tag will resolve this data binding expression, and display its value.

    <netui:span 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:span value="${pageFlow.somethingNull}" defaultValue="&nbsp;"/>

In this next sample, the HTML will contain the text "&amp;nbsp;" and the user will see '&nbsp;'

    <netui:span value="${pageFlow.somethingNull}" defaultValue="&amp;nbsp;"/>


Tag Information
Tag Classorg.apache.beehive.netui.tags.html.Span
TagExtraInfo ClassNone
Body ContentJSP
Display NameNone