Author: tmjee Date: Fri Jul 7 11:48:16 2006 New Revision: 419952 URL: http://svn.apache.org/viewvc?rev=419952&view=rev Log: WW-1364 - add optgroup tag
Added: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/OptGroup.java (with props) struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/OptGroupModel.java (with props) struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/OptGroupTag.java (with props) struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/components/OptGroupDirective.java (with props) struts/struts2/trunk/core/src/main/resources/template/simple/optgroup.ftl struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptGroupTest.java (with props) struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-1.txt (with props) struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-2.txt (with props) struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-3.txt (with props) Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/StrutsModels.java struts/struts2/trunk/core/src/main/resources/template/simple/select.ftl Added: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/OptGroup.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/OptGroup.java?rev=419952&view=auto ============================================================================== --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/OptGroup.java (added) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/OptGroup.java Fri Jul 7 11:48:16 2006 @@ -0,0 +1,149 @@ +/* + * $Id: MergeIterator.java 418521 2006-07-01 23:36:50Z tmjee $ + * + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.struts2.components; + +import java.io.Writer; +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import com.opensymphony.xwork.util.OgnlValueStack; + +/** + * <!-- START SNIPPET: javadoc --> + * + * Create a optgroup component which needs to resides within a select tag. + * + * <!-- END SNIPPET: javadoc --> + * + * <p/> + * + * <!-- START SNIPPET: notice --> + * + * This component is to be used within a Select component. + * + * <!-- END SNIPPET: notice --> + * + * <p/> + * + * <pre> + * <!-- START SNIPPET: example --> + * + * <ww:select label="My Selection" + * name="mySelection" + * value="%{'POPEYE'}" + * list="%{#{'SUPERMAN':'Superman', 'SPIDERMAN':'spiderman'}}"> + * <ww:optgroup label="Adult" + * list="%{#{'SOUTH_PARK':'South Park'}}" /> + * <ww:optgroup label="Japanese" + * list="%{#{'POKEMON':'pokemon','DIGIMON':'digimon','SAILORMOON':'Sailormoon'}}" /> + * </ww:select> + * + * <!-- END SNIPPET: example --> + * </pre> + * + * @a2.tag name="optgroup" tld-body-content="JSP" tld-tag-class="com.opensymphony.webwork.views.jsp.ui.OptGroupTag" + * description="Renders a Select Tag's OptGroup Tag" + */ +public class OptGroup extends Component { + + public static final String INTERNAL_LIST_UI_BEAN_LIST_PARAMETER_KEY = "optGroupInternalListUiBeanList"; + + private static Log _log = LogFactory.getLog(OptGroup.class); + + protected HttpServletRequest req; + protected HttpServletResponse res; + + protected ListUIBean internalUiBean; + + public OptGroup(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) { + super(stack); + this.req = req; + this.res = res; + internalUiBean = new ListUIBean(stack, req, res) { + protected String getDefaultTemplate() { + return "empty"; + } + }; + } + + public boolean end(Writer writer, 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; + } + + /** + * Set the label attribute. + * @a2.tagattribute required="false" + */ + public void setLabel(String label) { + internalUiBean.setLabel(label); + } + + /** + * Set the disable attribute. + * @a2.tagattribute required="false" + */ + public void setDisabled(String disabled) { + internalUiBean.setDisabled(disabled); + } + + /** + * Set the list attribute. + * @a2.tagattribute required="false" + */ + public void setList(String list) { + internalUiBean.setList(list); + } + + /** + * Set the listKey attribute. + * @a2.tagattribute required="false" + */ + public void setListKey(String listKey) { + internalUiBean.setListKey(listKey); + } + + /** + * Set the listValue attribute. + * @a2.tagattribute required="false" + */ + public void setListValue(String listValue) { + internalUiBean.setListValue(listValue); + } +} Propchange: struts/struts2/trunk/core/src/main/java/org/apache/struts2/components/OptGroup.java ------------------------------------------------------------------------------ svn:eol-style = native Added: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/OptGroupModel.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/OptGroupModel.java?rev=419952&view=auto ============================================================================== --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/OptGroupModel.java (added) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/OptGroupModel.java Fri Jul 7 11:48:16 2006 @@ -0,0 +1,39 @@ +/* + * $Id: MergeIterator.java 418521 2006-07-01 23:36:50Z tmjee $ + * + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.struts2.views.freemarker.tags; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts2.components.Component; +import org.apache.struts2.components.OptGroup; +import com.opensymphony.xwork.util.OgnlValueStack; + +/** + * Freemarker's TransformModel for OptGroup component. + * + */ +public class OptGroupModel extends TagModel { + public OptGroupModel(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) { + super(stack, req, res); + } + + protected Component getBean() { + return new OptGroup(stack, req, res); + } +} Propchange: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/OptGroupModel.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/StrutsModels.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/StrutsModels.java?rev=419952&r1=419951&r2=419952&view=diff ============================================================================== --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/StrutsModels.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/tags/StrutsModels.java Fri Jul 7 11:48:16 2006 @@ -74,6 +74,7 @@ protected TreeModel treeModel; protected UpDownSelectModel updownselect; protected RichTextEditorModel richtexteditorModel; + protected OptGroupModel optGroupModel; public StrutsModels(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) { @@ -427,5 +428,12 @@ richtexteditorModel = new RichTextEditorModel(stack, req, res); } return richtexteditorModel; + } + + public OptGroupModel getOptgroup() { + if (optGroupModel == null) { + optGroupModel = new OptGroupModel(stack, req, res); + } + return optGroupModel; } } Added: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/OptGroupTag.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/OptGroupTag.java?rev=419952&view=auto ============================================================================== --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/OptGroupTag.java (added) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/OptGroupTag.java Fri Jul 7 11:48:16 2006 @@ -0,0 +1,63 @@ +/* + * $Id: StrutsModels.java 418521 2006-07-01 23:36:50Z tmjee $ + * + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.struts2.views.jsp.ui; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts2.components.Component; +import org.apache.struts2.components.OptGroup; +import org.apache.struts2.views.jsp.ComponentTagSupport; +import com.opensymphony.xwork.util.OgnlValueStack; + +/** + * + */ +public class OptGroupTag extends ComponentTagSupport { + + private static final long serialVersionUID = 7367401003498678762L; + + protected String list; + protected String label; + protected String disabled; + + public Component getBean(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) { + return new OptGroup(stack, req, res); + } + + protected void populateParams() { + super.populateParams(); + + OptGroup optGroup = (OptGroup) component; + optGroup.setList(list); + optGroup.setLabel(label); + optGroup.setDisabled(disabled); + } + + public void setList(String list) { + this.list = list; + } + + public void setLabel(String label) { + this.label = label; + } + + public void setDisabled(String disabled) { + this.disabled = disabled; + } +} Propchange: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/ui/OptGroupTag.java ------------------------------------------------------------------------------ svn:eol-style = native Added: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/components/OptGroupDirective.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/components/OptGroupDirective.java?rev=419952&view=auto ============================================================================== --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/components/OptGroupDirective.java (added) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/components/OptGroupDirective.java Fri Jul 7 11:48:16 2006 @@ -0,0 +1,40 @@ +/* + * $Id: MergeIterator.java 418521 2006-07-01 23:36:50Z tmjee $ + * + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.struts2.views.velocity.components; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts2.components.Component; +import org.apache.struts2.components.OptGroup; +import com.opensymphony.xwork.util.OgnlValueStack; + + +/** + * OptGroup velocity directive. + */ +public class OptGroupDirective extends AbstractDirective { + + protected Component getBean(OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res) { + return new OptGroup(stack, req, res); + } + + public String getBeanName() { + return "optgroup"; + } +} Propchange: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/velocity/components/OptGroupDirective.java ------------------------------------------------------------------------------ svn:eol-style = native Added: struts/struts2/trunk/core/src/main/resources/template/simple/optgroup.ftl URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/template/simple/optgroup.ftl?rev=419952&view=auto ============================================================================== --- struts/struts2/trunk/core/src/main/resources/template/simple/optgroup.ftl (added) +++ struts/struts2/trunk/core/src/main/resources/template/simple/optgroup.ftl Fri Jul 7 11:48:16 2006 @@ -0,0 +1,27 @@ +<#if parameters.optGroupInternalListUiBeanList?exists> +<#assign optGroupInternalListUiBeans=parameters.optGroupInternalListUiBeanList /> +<#list optGroupInternalListUiBeans as optGroupInternalListUiBean> +<optgroup + <#if optGroupInternalListUiBean.parameters.label?exists> + label="${optGroupInternalListUiBean.parameters.label}" + </#if> + <#if optGroupInternalListUiBean.parameters.disabled?default(false)> + disabled="disabled" + </#if> +> + +<#list optGroupInternalListUiBean.parameters.list as optGroupBean> +<#assign trash=stack.push(optGroupBean) /> + <#assign tmpKey=stack.findValue(optGroupInternalListUiBean.parameters.listKey) /> + <#assign tmpValue=stack.findValue(optGroupInternalListUiBean.parameters.listValue) /> + <option value="${tmpKey}" + <#if tag.contains(parameters.nameValue, tmpKey) == true> + selected="selected" + </#if> + >${tmpValue} + </option> +<#assign trash=stack.pop() /> +</#list> +</optgroup> +</#list> +</#if> Modified: struts/struts2/trunk/core/src/main/resources/template/simple/select.ftl URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/template/simple/select.ftl?rev=419952&r1=419951&r2=419952&view=diff ============================================================================== --- struts/struts2/trunk/core/src/main/resources/template/simple/select.ftl (original) +++ struts/struts2/trunk/core/src/main/resources/template/simple/select.ftl Fri Jul 7 11:48:16 2006 @@ -51,4 +51,7 @@ </#if> >${itemValue?html}</option><#lt/> </@saf.iterator> + +<#include "/${parameters.templateDir}/simple/optgroup.ftl" /> + </select> Added: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptGroupTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptGroupTest.java?rev=419952&view=auto ============================================================================== --- struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptGroupTest.java (added) +++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptGroupTest.java Fri Jul 7 11:48:16 2006 @@ -0,0 +1,120 @@ +/* + * $Id: StrutsModels.java 418521 2006-07-01 23:36:50Z tmjee $ + * + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.struts2.views.jsp.ui; + +import org.apache.struts2.views.jsp.AbstractUITagTest; + +/** + * + */ +public class OptGroupTest extends AbstractUITagTest { + + + public void testOptGroupSimple() throws Exception { + SelectTag selectTag = new SelectTag(); + selectTag.setName("mySelection"); + selectTag.setLabel("My Selection"); + selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}"); + + OptGroupTag optGroupTag1 = new OptGroupTag(); + optGroupTag1.setLabel("My Label 1"); + optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}"); + + OptGroupTag optGroupTag2 = new OptGroupTag(); + optGroupTag2.setLabel("My Label 2"); + optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}"); + + selectTag.setPageContext(pageContext); + selectTag.doStartTag(); + optGroupTag1.setPageContext(pageContext); + optGroupTag1.doStartTag(); + optGroupTag1.doEndTag(); + optGroupTag2.setPageContext(pageContext); + optGroupTag2.doStartTag(); + optGroupTag2.doEndTag(); + selectTag.doEndTag(); + + + //System.out.println(writer.toString()); + verify(SelectTag.class.getResource("OptGroup-1.txt")); + } + + + public void testOptGroupWithSingleSelect() throws Exception { + + SelectTag selectTag = new SelectTag(); + selectTag.setName("mySelection"); + selectTag.setLabel("My Selection"); + selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}"); + selectTag.setValue("%{'EEE'}"); + + OptGroupTag optGroupTag1 = new OptGroupTag(); + optGroupTag1.setLabel("My Label 1"); + optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}"); + + OptGroupTag optGroupTag2 = new OptGroupTag(); + optGroupTag2.setLabel("My Label 2"); + optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}"); + + selectTag.setPageContext(pageContext); + selectTag.doStartTag(); + optGroupTag1.setPageContext(pageContext); + optGroupTag1.doStartTag(); + optGroupTag1.doEndTag(); + optGroupTag2.setPageContext(pageContext); + optGroupTag2.doStartTag(); + optGroupTag2.doEndTag(); + selectTag.doEndTag(); + + + //System.out.println(writer.toString()); + verify(SelectTag.class.getResource("OptGroup-2.txt")); + } + + + public void testOptGroupWithMultipleSelect() throws Exception { + SelectTag selectTag = new SelectTag(); + selectTag.setMultiple("true"); + selectTag.setName("mySelection"); + selectTag.setLabel("My Selection"); + selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}"); + selectTag.setValue("%{{'EEE','BBB','TWO'}}"); + + OptGroupTag optGroupTag1 = new OptGroupTag(); + optGroupTag1.setLabel("My Label 1"); + optGroupTag1.setList("%{#{'AAA':'aaa','BBB':'bbb','CCC':'ccc'}}"); + + OptGroupTag optGroupTag2 = new OptGroupTag(); + optGroupTag2.setLabel("My Label 2"); + optGroupTag2.setList("%{#{'DDD':'ddd','EEE':'eee','FFF':'fff'}}"); + + selectTag.setPageContext(pageContext); + selectTag.doStartTag(); + optGroupTag1.setPageContext(pageContext); + optGroupTag1.doStartTag(); + optGroupTag1.doEndTag(); + optGroupTag2.setPageContext(pageContext); + optGroupTag2.doStartTag(); + optGroupTag2.doEndTag(); + selectTag.doEndTag(); + + + //System.out.println(writer.toString()); + verify(SelectTag.class.getResource("OptGroup-3.txt")); + } +} Propchange: struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/OptGroupTest.java ------------------------------------------------------------------------------ svn:eol-style = native Added: struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-1.txt URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-1.txt?rev=419952&view=auto ============================================================================== --- struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-1.txt (added) +++ struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-1.txt Fri Jul 7 11:48:16 2006 @@ -0,0 +1,40 @@ +<tr> + <td class="tdLabel"><label for="mySelection" class="label">My Selection:</label></td> + <td> +<select name="mySelection" id="mySelection"> + <option value="ONE">one</option> + <option value="TWO">two</option> + <option value="THREE">three</option> + +<optgroup + label="My Label 1" +> + + <option value="AAA" + >aaa + </option> + <option value="BBB" + >bbb + </option> + <option value="CCC" + >ccc + </option> +</optgroup> +<optgroup + label="My Label 2" +> + + <option value="DDD" + >ddd + </option> + <option value="EEE" + >eee + </option> + <option value="FFF" + >fff + </option> +</optgroup> + +</select> +</td> +</tr> \ No newline at end of file Propchange: struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-1.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-2.txt URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-2.txt?rev=419952&view=auto ============================================================================== --- struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-2.txt (added) +++ struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-2.txt Fri Jul 7 11:48:16 2006 @@ -0,0 +1,41 @@ +<tr> + <td class="tdLabel"><label for="mySelection" class="label">My Selection:</label></td> + <td> +<select name="mySelection" id="mySelection"> + <option value="ONE">one</option> + <option value="TWO">two</option> + <option value="THREE">three</option> + +<optgroup + label="My Label 1" +> + + <option value="AAA" + >aaa + </option> + <option value="BBB" + >bbb + </option> + <option value="CCC" + >ccc + </option> +</optgroup> +<optgroup + label="My Label 2" +> + + <option value="DDD" + >ddd + </option> + <option value="EEE" + selected="selected" + >eee + </option> + <option value="FFF" + >fff + </option> +</optgroup> + +</select> +</td> +</tr> \ No newline at end of file Propchange: struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-2.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-3.txt URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-3.txt?rev=419952&view=auto ============================================================================== --- struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-3.txt (added) +++ struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-3.txt Fri Jul 7 11:48:16 2006 @@ -0,0 +1,42 @@ +<tr> + <td class="tdLabel"><label for="mySelection" class="label">My Selection:</label></td> + <td> +<select name="mySelection" id="mySelection" multiple="multiple"> + <option value="ONE">one</option> + <option value="TWO" selected="selected">two</option> + <option value="THREE">three</option> + +<optgroup + label="My Label 1" +> + + <option value="AAA" + >aaa + </option> + <option value="BBB" + selected="selected" + >bbb + </option> + <option value="CCC" + >ccc + </option> +</optgroup> +<optgroup + label="My Label 2" +> + + <option value="DDD" + >ddd + </option> + <option value="EEE" + selected="selected" + >eee + </option> + <option value="FFF" + >fff + </option> +</optgroup> + +</select> +</td> +</tr> \ No newline at end of file Propchange: struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/OptGroup-3.txt ------------------------------------------------------------------------------ svn:eol-style = native