OptGrouppublic class OptGroup extends Component
Create a optgroup component which needs to resides within a select tag.
This component is to be used within a Select component.
<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>
|
Fields Summary |
---|
public static final String | INTERNAL_LIST_UI_BEAN_LIST_PARAMETER_KEY | private static Log | _log | protected HttpServletRequest | req | protected HttpServletResponse | res | protected ListUIBean | internalUiBean |
Methods Summary |
---|
public boolean | end(java.io.Writer writer, java.lang.String body)
Select select = (Select) findAncestor(Select.class);
if (select == null) {
_log.error("incorrect use of OptGroup component, this component must be used within a Select component",
new IllegalStateException("incorrect use of OptGroup component, this component must be used within a Select component"));
return false;
}
internalUiBean.start(writer);
internalUiBean.end(writer, body);
List listUiBeans = (List) select.getParameters().get(INTERNAL_LIST_UI_BEAN_LIST_PARAMETER_KEY);
if (listUiBeans == null) {
listUiBeans = new ArrayList();
}
listUiBeans.add(internalUiBean);
select.addParameter(INTERNAL_LIST_UI_BEAN_LIST_PARAMETER_KEY, listUiBeans);
return false;
| public void | setContainer(com.opensymphony.xwork2.inject.Container container)
container.inject(internalUiBean);
| public void | setDisabled(java.lang.String disabled)
internalUiBean.setDisabled(disabled);
| public void | setLabel(java.lang.String label)
internalUiBean.setLabel(label);
| public void | setList(java.lang.String list)
internalUiBean.setList(list);
| public void | setListKey(java.lang.String listKey)
internalUiBean.setListKey(listKey);
| public void | setListValue(java.lang.String listValue)
internalUiBean.setListValue(listValue);
|
|