Apache Struts 2 Documentation > Home > Guides > Tag Developers Guide > Struts Tags > Tag Reference > UI Tag Reference > optgroup
Added by tm_jee, last edited by Ted Husted on Sep 02, 2006  (view change) show comment
Please make sure you have read the Tag Syntax document and understand how tag attribute syntax works.

Description

Content pulled from external source. Click here to refresh.

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

Content pulled from external source. Click here to refresh.

This component is to be used within a Select component.

Parameters

Content pulled from external source. Click here to refresh.

Name

Required

Default

Type

Description

label false   Object/String Set the label attribute.
disabled false   Object/String Set the disable attribute.
list false   Object/String Set the list attribute.
listKey false   Object/String Set the listKey attribute.
listValue false   Object/String Set the listValue attribute.
id false   Object/String id for referencing element. For UI and form tags it will be used as HTML id attribute

Examples

Content pulled from external source. Click here to refresh.
<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>