Apache Struts 2 Documentation > Home > Guides > Tag Developers Guide > Struts Tags > Tag Reference > UI Tag Reference > optgroup |

Apache Struts 2 Documentation
optgroup
Edit Page Browse Space Add Page Add News
Added by tm_jee, last edited by Don Brown on Jan 06, 2007 (view change)

| Please make sure you have read the Tag Syntax document and understand how tag attribute syntax works.

## Description

Create a optgroup component which needs to resides within a select tag.

| This component is to be used within a Select component.

## Parameters

#### Name | #### Required | #### Default | #### Evaluated | #### Type | #### Description
--- | --- | --- | --- | --- | ---
disabled | false |  | true | String | Set the disable attribute.
id | false |  | true | String | id for referencing element. For UI and form tags it will be used as HTML id attribute
label | false |  | true | String | Set the label attribute
list | false |  | true | String | Set the list attribute.
listKey | false |  | true | String | Set the listKey attribute.
listValue | false |  | true | String | Set the listValue attribute.

## Examples

    <s:select label="My Selection"
               name="mySelection"
               value="%{'POPEYE'}"
               list="%{#{'SUPERMAN':'Superman', 'SPIDERMAN':'spiderman'}}">
       <s:optgroup label="Adult"
                    list="%{#{'SOUTH_PARK':'South Park'}}" />
       <s:optgroup label="Japanese"
                    list="%{#{'POKEMON':'pokemon','DIGIMON':'digimon','SAILORMOON':'Sailormoon'}}" />
    </s:select>