<netui:span> Tag

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

Syntax

<netui:span
    [defaultValue="defaultValue"]
    [dir="dir"]
    [escapeWhiteSpaceForHtml="escapeWhiteSpaceForHtml"]
    [formatDefaultValue="formatDefaultValue"]
    [lang="lang"]
    [onClick="onClick"]
    [onDblClick="onDblClick"]
    [onKeyDown="onKeyDown"]
    [onKeyPress="onKeyPress"]
    [onKeyUp="onKeyUp"]
    [onMouseDown="onMouseDown"]
    [onMouseMove="onMouseMove"]
    [onMouseOut="onMouseOut"]
    [onMouseOver="onMouseOver"]
    [onMouseUp="onMouseUp"]
    [style="style"]
    [styleClass="styleClass"]
    [tagId="tagId"]
    [title="title"]
    value="value" />

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  |   Supports runtime evaluation: Yes  |   Data bindable:

dir
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The dir.
escapeWhiteSpaceForHtml
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable:

formatDefaultValue
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable:

lang
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The lang.
onClick
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The onClick JavaScript event.
onDblClick
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The onDblClick JavaScript event.
onKeyDown
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The onKeyDown JavaScript event.
onKeyPress
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The onKeyPress JavaScript event.
onKeyUp
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The onKeyUp JavaScript event.
onMouseDown
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The onMouseDown JavaScript event.
onMouseMove
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The onMouseMove JavaScript event.
onMouseOut
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The onMouseOut JavaScript event.
onMouseOver
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The onMouseOver JavaScript event.
onMouseUp
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The onMouseUp JavaScript event.
style
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The style.
styleClass
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The style class.
tagId
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

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.

title
Required: No  |   Supports runtime evaluation: Yes  |   Data bindable: No

The title.
value
Required: Yes  |   Supports runtime evaluation: Yes  |   Data bindable:


 
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;"/>