C H A P T E R  19

listbox


<jato:listbox>

Renders an HTML list as comprised of an HTML <input type="select"> element containing an arbitrary number of HTML <option> elements. This tag offers the convenience of treating the list as a single element and the flexibility of dynamic list content generation.

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:listbox name="itemSize" size="4" multiple="false"/>

The above would be rendered into the following HTML:

<select name="PageFoo.itemSize" size="4">

<option value="S">Small</option>

<option value="M">Medium</option>

<option value="L">Large</option>

<option value="XL">Extra Large</option>

</select>

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

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 this HTML element

RTExpr

multiple

Valid values: "true" or "false"

A value of "true" specifies that multiple items can be selected by the user.

A value of "false" specifies that only a single item can be selected by the user.

If not specified, "false" is assumed.

 

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.html.SelectableGroup

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

size

Valid values: positive number

Specifies the number of rows in the list that should be visible at the same time.

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

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.

 

 

This tag also supports the following JavaScript events:

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