Author: dvinnichek
Date: 2010-08-02 11:49:40 -0400 (Mon, 02 Aug 2010)
New Revision: 23867
Added:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/option.jsp
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/option.jsp.xml
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/options.jsp
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/options.jsp.xml
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/springapp-servlet.xml
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/index.jsp
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/src/org/jboss/tools/vpe/spring/test/SpringComponentContentTest.java
Log:
add tests for form:option and form:options
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java 2010-08-02
12:59:50 UTC (rev 23866)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java 2010-08-02
15:49:40 UTC (rev 23867)
@@ -40,9 +40,13 @@
VpeSpringUtil.copyCommonAttributes(sourceElement, select);
VpeSpringUtil.copyAttribute(sourceElement, HTML.ATTR_SIZE,
select, HTML.ATTR_SIZE);
- VpeSpringUtil.copyAttribute(sourceElement, HTML.ATTR_MULTIPLE,
- select, HTML.ATTR_MULTIPLE);
+ if (sourceElement.hasAttribute(HTML.ATTR_MULTIPLE) &&
+ sourceElement.getAttribute(HTML.ATTR_MULTIPLE).equalsIgnoreCase(Boolean.TRUE.toString()))
{
+ VpeSpringUtil.copyAttribute(sourceElement, HTML.ATTR_MULTIPLE,
+ select, HTML.ATTR_MULTIPLE);
+ }
+
if (Spring.VALUE_TRUE.equals(sourceElement.getAttribute(Spring.ATTR_DISABLED))) {
select.setAttribute(HTML.ATTR_DISABLED, HTML.ATTR_DISABLED);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-08-02
12:59:50 UTC (rev 23866)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.spring/templates/vpe-templates-spring.xml 2010-08-02
15:49:40 UTC (rev 23867)
@@ -276,14 +276,14 @@
<vpe:if test="@disabled='true'">
<vpe:if test="attrpresent('itemLabel')">
<vpe:template children="yes" modify="yes">
- <option id="{@id}" class="{@cssClass}"
style="{@cssStyle}"
+ <option id="{@id}1" class="{@cssClass}"
style="{@cssStyle}"
dir="{@dir}" disabled="disabled">
<vpe:value expr="{@items}.{(a)itemLabel}" />
</option>
</vpe:template>
</vpe:if>
<vpe:template children="yes" modify="yes">
- <option id="{@id}" class="{@cssClass}"
style="{@cssStyle}"
+ <option id="{@id}1" class="{@cssClass}"
style="{@cssStyle}"
dir="{@dir}" disabled="disabled">
<vpe:value expr="{@items}" />
</option>
@@ -291,14 +291,14 @@
</vpe:if>
<vpe:if test="attrpresent('itemLabel')">
<vpe:template children="yes" modify="yes">
- <option id="{@id}" class="{@cssClass}"
style="{@cssStyle}"
+ <option id="{@id}1" class="{@cssClass}"
style="{@cssStyle}"
dir="{@dir}">
<vpe:value expr="{@items}.{(a)itemLabel}" />
</option>
</vpe:template>
</vpe:if>
<vpe:template children="yes" modify="yes">
- <option id="{@id}" class="{@cssClass}"
style="{@cssStyle}"
+ <option id="{@id}1" class="{@cssClass}"
style="{@cssStyle}"
dir="{@dir}">
<vpe:value expr="{@items}" />
</option>
Added:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/option.jsp
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/option.jsp
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/option.jsp 2010-08-02
15:49:40 UTC (rev 23867)
@@ -0,0 +1,45 @@
+<%@ taglib prefix="form"
uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="c"
uri="http://java.sun.com/jstl/core" %>
+<html>
+<head>
+ <style>
+ .tall-option{
+ -moz-appearance: none;
+ height: 30px;
+ }
+ </style>
+</head>
+<body>
+ <h1>Test of form:option</h1>
+
+ <form:form modelAttribute="formBean">
+ <form:select path="selectedCategory">
+ <form:option id="booksOption1" value="books"/>
+ <form:option id="sportOption1" value="sport"/>
+ <form:option id="fishingOption1" value="fishing"/>
+ </form:select>
+ form:option with id attribute
+ <br/><br/>
+ <form:select path="selectedCategory">
+ <form:option id="booksOption2" value="books"
+ label="books selected"
+ cssStyle="width: 30px;" cssClass="tall-option"/>
+ <form:option id="sportOption2" value="sport"
+ label="sport selected"
+ cssStyle="width: 30px;" cssClass="tall-option"/>
+ <form:option id="fishingOption2" value="fishing"
+ label="fishing selected"
+ cssStyle="width: 30px;" cssClass="tall-option"/>
+ </form:select>
+ form:option with id, cssStyle, cssClass and label attributes.
+ <br/><br/>
+ <form:select path="selectedCategory">
+ <form:option id="booksOption3" value="books"
disabled="true"/>
+ <form:option id="sportOption3" value="sport"
disabled="true"/>
+ <form:option id="fishingOption3" value="fishing"/>
+ </form:select>
+ form:option with id and disabled='true' attributes.
+ </form:form>
+</body>
+</html>
+
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/option.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/option.jsp.xml
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/option.jsp.xml
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/option.jsp.xml 2010-08-02
15:49:40 UTC (rev 23867)
@@ -0,0 +1,11 @@
+<tests>
+ <test id="booksOption1">
+ <option id="booksOption1"></option>
+ </test>
+ <test id="booksOption2">
+ <option id="booksOption2" class="tall-option" style="width:
30px;">books selected</option>
+ </test>
+ <test id="booksOption3">
+ <option id="booksOption3"
disabled="disabled"></option>
+ </test>
+</tests>
\ No newline at end of file
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/option.jsp.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/options.jsp
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/options.jsp
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/options.jsp 2010-08-02
15:49:40 UTC (rev 23867)
@@ -0,0 +1,40 @@
+<%@ taglib prefix="form"
uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="c"
uri="http://java.sun.com/jstl/core" %>
+<html>
+<head>
+ <style>
+ .tall-options {
+ -moz-appearance: none;
+ height: 30px;
+ }
+ </style>
+</head>
+<body>
+ <h1>Test of form:options</h1>
+
+ <form:form modelAttribute="formBean">
+
+ <form:select path="selectedCategories1">
+ <form:options id="options1"
items="${formBean.availableCategories}"/>
+ </form:select>
+ form:options with id and items attribute
+ <br/><br/>
+
+ <form:select path="selectedCategories2">
+ <form:options id="options2" disabled="true"
+ cssStyle="width: 30px;" cssClass="tall-options"
+ items="${formBean.availableCategories}"/>
+ </form:select>
+ form:options with id, cssStyle, cssClass and disabled='true' attributes.
+ <br/><br/>
+
+ <form:select path="selectedCategories3">
+ <form:options id="options3"
+ itemLabel="id" itemValue="id"
+ items="${formBean.favoriteCategories}"/>
+ </form:select>
+ form:options with id and itemLabel attributes.
+ <br/><br/>
+ </form:form>
+</body>
+</html>
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/options.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/options.jsp.xml
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/options.jsp.xml
(rev 0)
+++
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/options.jsp.xml 2010-08-02
15:49:40 UTC (rev 23867)
@@ -0,0 +1,11 @@
+<tests>
+ <test id="options1">
+ <option id="options11">${formBean.availableCategories}</option>
+ </test>
+ <test id="options2">
+ <option id="options21" class="tall-options" style="width:
30px;" disabled="disabled"></option>
+ </test>
+ <test id="options3">
+ <option
id="options31">${formBean.favoriteCategories}.id</option>
+ </test>
+</tests>
\ No newline at end of file
Property changes on:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/options.jsp.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/springapp-servlet.xml
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/springapp-servlet.xml 2010-08-02
12:59:50 UTC (rev 23866)
+++
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/springapp-servlet.xml 2010-08-02
15:49:40 UTC (rev 23867)
@@ -12,6 +12,8 @@
<bean name="/checkboxes.htm"
class="org.jboss.tools.vpe.spring.test.springtest.FormController"/>
<bean name="/radiobutton.htm"
class="org.jboss.tools.vpe.spring.test.springtest.FormController"/>
<bean name="/radiobuttons.htm"
class="org.jboss.tools.vpe.spring.test.springtest.FormController"/>
+ <bean name="/option.htm"
class="org.jboss.tools.vpe.spring.test.springtest.FormController"/>
+ <bean name="/options.htm"
class="org.jboss.tools.vpe.spring.test.springtest.FormController"/>
<bean name="/errors.htm"
class="org.jboss.tools.vpe.spring.test.springtest.controller.ErrorsController">
<property name="validator" ref="fieldValidator"/>
</bean>
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/index.jsp
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/index.jsp 2010-08-02
12:59:50 UTC (rev 23866)
+++
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/index.jsp 2010-08-02
15:49:40 UTC (rev 23867)
@@ -6,6 +6,10 @@
<br/>
<a href="radiobuttons.htm">radiobuttons.htm</a>
<br/>
+<a href="option.htm">option.htm</a>
+<br/>
+<a href="options.htm">options.htm</a>
+<br/>
<a href="form.htm">form.htm</a>
<br/>
<a href="errors.htm">errors.htm</a>
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/src/org/jboss/tools/vpe/spring/test/SpringComponentContentTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/src/org/jboss/tools/vpe/spring/test/SpringComponentContentTest.java 2010-08-02
12:59:50 UTC (rev 23866)
+++
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/src/org/jboss/tools/vpe/spring/test/SpringComponentContentTest.java 2010-08-02
15:49:40 UTC (rev 23867)
@@ -46,6 +46,14 @@
public void testRadiobuttons() throws Throwable {
performContentTestByFullPath("src/main/webapp/WEB-INF/jsp/radiobuttons.jsp");
//$NON-NLS-1$
}
+
+ public void testOption() throws Throwable {
+ performContentTestByFullPath("src/main/webapp/WEB-INF/jsp/option.jsp");
//$NON-NLS-1$
+ }
+
+ public void testOptions() throws Throwable {
+ performContentTestByFullPath("src/main/webapp/WEB-INF/jsp/options.jsp");
//$NON-NLS-1$
+ }
public void testErrors() throws Throwable {
performContentTestByFullPath("src/main/webapp/WEB-INF/jsp/errors.jsp");
//$NON-NLS-1$