C H A P T E R  23

textArea


<jato:textArea>

Renders an HTML <textarea> element.

This tag is only valid when enclosed by both an HTML <form> element and a useViewBean, containerView, or tiledView tag. This tag may not contain any body content.

Example:

<jato:textArea name="comments" cols="80" rows="5" wrap="virtual"/>

The above would be rendered into the following HTML:

<textarea name="PageFoo.comments" cols="80" rows="5" wrap="virtual">

...

</textarea>

Attribute Name

Description

Notes

accessKey

Assigns an access key to the rendered HTML element. In general, the access key should be included in label text or wherever the access key is to apply.

RTExpr

cols

Valid values: positive number

Specifies the visible width of the field in average character widths.

Req, RTExpr

defaultValue

The value to use, if the DisplayField view peer's value is null.

For a textArea tag, "value" refers to the text that will be rendered between the opening and closing tag of the textarea element

RTExpr

disabled

Valid values: "true" or "false"

Disables the HTML control for user input.

  • Disabled controls do not receive focus
  • Disabled controls are skipped in tabbing navigation

If not specified, "false" is assumed.

RTExpr

elementId

Assigns a name to an element. This name must be unique in an HTML document. Please note, this corresponds to the HTML "id" attribute. It has no specific meaning to the JATO framework.

The id attribute has several roles in HTML:

  • As a style sheet selector
  • As a target anchor for hypertext links
  • As a means to reference a particular element from a script

RTExpr

extraHtml

Arbitrary HTML that will be rendered just prior to the closing ">" of the opening <textarea> element

RTExpr

formatMask

The valid values for the formatMask attribute depend on the value of formatType attribute.

For formatType values of "string" or "alpha":

The format mask consists of any arbitrary combination of static text and the reserved metacharacter "?". Each "?" metacharacter serves as a placeholder for a single character in the value being formatted, proceeding from left to right. A literal "?" can be specified by escaping the "?" character with "\\".

For formatType values of "DEC" or "curr":

The format mask consists of two patterns separated by a semicolon: a primary pattern (specifies precision and thousandths separator) and a negative number pattern (see java.text.DecimalFormat for pattern details).

(*See table below.)

 

formatType

Valid values: "string" (also "alpha"), "DEC", or "curr", or "date"

Each type has specific masking rules (see the formatMask attribute for details).

A value of "string" supports the formatting of arbitrary text via the application of a simple text mask. This allows dynamic content to be arbitrarily combined with static text. A value of "alpha" is identical to "string".

A value of "DEC" supports the formatting of numeric values via the application of a numeric mask.

A value of "curr" supports the formatting of currency values via the application of a currency mask. The currency format should simply take a decimal specification and apply the locale specific currency format. Currently, currency formatting is not working due to an unresolved bug.

A value of "date", although legal, at present has no supporting date formatting implementation, due to the fact that the java.text.DateFormat class does not lend itself easily to the generic formatting support that a taglib implementation would require. We are investigating ways around this limitation.

Therefore, it is suggested that developers wishing to apply date formatting implement the begin<fieldName>Display(ChildDisplayEvent event) and/or end<fieldName>Display(ChildContentDisplayEvent event) events and therein take explicit advantage of the date formatting support available in the java.text.DateFormat class.

The JATO implementation of text formatting relies heavily on the java.text package and the format related classes therein. Please see that package for more information. See also the <JATO package>.util.HtmlUtil class.

 

name

The name of the DisplayField peer. This peer must be a child of the current parent ContainerView, TiledView, or ViewBean. The DisplayField name is resolved relative to the current parent view.

The view peer must be of type <JATO package>.view.DisplayField

This name may be a qualified view path, using forward slashes ("/") as delimiters. All components in the path except the last must refer to a ContainerView or a derivative of ContainerView (such as TiledView). Both relative and absolute paths are possible. If a name path begins with a forward slash, the name is assumed to be relative to the root view (the ViewBean). If the path does not begin with a forward slash, the name is assumed to refer to a child relative to the current container. Two dots ("..") may be used to refer to the container that is the parent of the current container.

Examples:

/header/orderList/customerName (absolute from root view)

orderList/customerName (relative to current container)

../footer/orderList/customerName (relative to parent)

Req

readOnly

Valid values: "true" or "false"

A value of "true" specifies that the text contained within this element cannot be changed by the user.

If not specified, "false" is assumed.

RTExpr

rows

Valid values: positive number

Specifies the number of visible text lines in the rendered control

Req, RTExpr

style

CSS styles to be applied to this HTML element.

RTExpr

styleClass

CSS stylesheet class to be applied to this HTML element.

RTExpr

tabIndex

Specifies the position of the current element in the tabbing order for the current document. This value must be a number between 0 and 32767.

 

wrap

Valid values: valid wrap type supported by the browser, such as "virtual" or "physical"

Specifies the value that will be rendered in the HTML textarea element's "wrap" attribute.

If not specified, the wrap attribute is omitted from the rendered HTML

RTExpr

 

This tag also supports the following JavaScript events:

onBlur, onChange, onClick, onDblClick, onFocus, onKeyDown, onKeyPress, onKeyUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onSelect

 


(*See formatMask above.)

Format Type

Format Mask

Sample Value

Rendered Value

string

???-??-????

123456789

123-45-6789

string

??HELLO??

abcd

abHELLOcd

string

??HELLO\\???

abcd

abHELLO?cd

DEC

###0; (-#)

1000000.99

1000001

DEC

#,##0.00; (-#)

1000000.99

1,000,000.99

DEC

###0.00; (-#)

1000000.99

1000000.99

DEC

###0; (-#)

-1000000.99

(-1000001

BUG - Should be

(-1000001)

DEC

###0; (#)

-1000000.99

(1000001

BUG - Should be

(1000001)

DEC

#,##0.00; -#

-1000000.99

-1,000,000.99