select (Struts EL Tag library documentation)

Overview | Library | Tag | Help

| FRAMES NO FRAMES

## html
Tag select

Render A Select Element

Renders an HTML `<select>` element, associated with a bean property specified by our attributes. This tag is only valid when nested inside a form tag body.

This tag operates in two modes, depending upon the state of the `multiple` attribute, which affects the data type of the associated property you should use:

- multiple="true" IS NOT selected - The corresponding property should be a scalar value of any supported data type.
- multiple="true" IS selected - The corresponding property should be an array of any supported data type.

WARNING: In order to correctly recognize cases where no selection at all is made, the `ActionForm` bean associated with this form must include a statement resetting the scalar property to a default value (if `multiple` is not set), or the array property to zero length (if `multiple` is set) in the `reset()` method.

Tag Information
Tag Class | org.apache.strutsel.taglib.html.ELSelectTag
TagExtraInfo Class | None
Body Content | JSP
Display Name | None

Attributes
Name | Required | Request-time | Type | Description
alt | false | true | `java.lang.String` | The alternate text for this element.
altKey | false | true | `java.lang.String` | The message resources key of the alternate text for this element.

bundle

false

true

`java.lang.String`

The servlet context attributes key for the MessageResources instance to use. If not specified, defaults to the application resources configured for our action servlet.

Since:
  Struts 1.2.5

dir

false

true

`java.lang.String`

The direction for weak/neutral text for this element.

Since:
  Struts 1.3.6

disabled | false | true | `java.lang.String` | Set to `true`

errorKey

false

true

`java.lang.String`

Name of the bean (in any scope) under which our error messages have been stored. If not present, the name specified by the `Globals.ERROR_KEY` constant string will be used.

N.B. This is used in conjunction with the `errorStyle`, `errorStyleClass` and `errorStyleId` attributes and should be set to the same value as the `name` attribute on the `<html:errors/>` tag.

Since:
  Struts 1.2.5

errorStyle

false

true

`java.lang.String`

CSS styles to be applied to this HTML element if an error exists for it.

N.B. If present, this overrides the `style` attribute in the event of an error.

Since:
  Struts 1.2.5

errorStyleClass

false

true

`java.lang.String`

CSS stylesheet class to be applied to this HTML element if an error exists for it (renders a "class" attribute).

N.B. If present, this overrides the `styleClass` attribute in the event of an error.

Since:
  Struts 1.2.5

errorStyleId

false

true

`java.lang.String`

Identifier to be assigned to this HTML element if an error exists for it (renders an "id" attribute).

N.B. If present, this overrides the `styleId` attribute in the event of an error.

Since:
  Struts 1.2.5

indexed | false | true | `java.lang.String` | Valid only inside of `logic-el:iterate` `c:forEach` `true`

lang

false

true

`java.lang.String`

The language code for this element.

Since:
  Struts 1.3.6

multiple | false | true | `java.lang.String` | If set to any arbitrary value, the rendered select element will support multiple selections.
name | false | true | `java.lang.String` | The attribute name of the bean whose properties are consulted to determine which option should be pre-selected when rendering this input field. If not specified, the bean associated with the enclosing `<html:form>`
onblur | false | true | `java.lang.String` | JavaScript event handler executed when this element loses input focus.
onchange | false | true | `java.lang.String` | JavaScript event handler executed when this element loses input focus and its value has changed.
onclick | false | true | `java.lang.String` | JavaScript event handler executed when this element receives a mouse click.
ondblclick | false | true | `java.lang.String` | JavaScript event handler executed when this element receives a mouse double click.
onfocus | false | true | `java.lang.String` | JavaScript event handler executed when this element receives input focus.
onkeydown | false | true | `java.lang.String` | JavaScript event handler executed when this element has focus and a key is depressed.
onkeypress | false | true | `java.lang.String` | JavaScript event handler executed when this element has focus and a key is depressed and released.
onkeyup | false | true | `java.lang.String` | JavaScript event handler executed when this element has focus and a key is released.
onmousedown | false | true | `java.lang.String` | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is depressed.
onmousemove | false | true | `java.lang.String` | JavaScript event handler executed when this element is under the mouse pointer and the pointer is moved.
onmouseout | false | true | `java.lang.String` | JavaScript event handler executed when this element was under the mouse pointer but the pointer was moved outside the element.
onmouseover | false | true | `java.lang.String` | JavaScript event handler executed when this element was not under the mouse pointer but the pointer is moved inside the element.
onmouseup | false | true | `java.lang.String` | JavaScript event handler executed when this element is under the mouse pointer and a mouse button is released.
property | true | true | `java.lang.String` | Name of the request parameter that will be included with this submission, set to the specified value.
style | false | true | `java.lang.String` | CSS styles to be applied to this HTML element. N.B. If present, the `errorStyle` overrides this attribute in the event of an error for the element.
styleClass | false | true | `java.lang.String` | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). N.B. If present, the `errorStyleClass` overrides this attribute in the event of an error for the element.
styleId | false | true | `java.lang.String` | Identifier to be assigned to this HTML element (renders an "id" attribute). N.B. If present, the `errorStyleId` overrides this attribute in the event of an error for the element.
tabindex | false | true | `java.lang.String` | The tab order (ascending positive integers) for this element.
size | false | true | `java.lang.String` | The number of available options displayed at one time.
title | false | true | `java.lang.String` | The advisory title for this element.
titleKey | false | true | `java.lang.String` | The message resources key for the advisory title for this element.
value | false | true | `java.lang.String` | The value to compare with for marking an option selected.

Variables
No Variables Defined.

Overview | Library | Tag | Help

| FRAMES NO FRAMES

Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.