You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2007/05/17 23:07:17 UTC
svn commit: r539116 - in /struts/struts2/branches/STRUTS_2_0_X/core/src:
main/resources/template/simple/combobox.ftl
test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java
test/resources/org/apache/struts2/views/jsp/ui/ComboBox-1.txt
Author: musachy
Date: Thu May 17 14:07:16 2007
New Revision: 539116
URL: http://svn.apache.org/viewvc?view=rev&rev=539116
Log:
WW-1858 combobox template is not correct when there is '.' in the name attribute (use id instead of name)
Modified:
struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/combobox.ftl
struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java
struts/struts2/branches/STRUTS_2_0_X/core/src/test/resources/org/apache/struts2/views/jsp/ui/ComboBox-1.txt
Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/combobox.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/combobox.ftl?view=diff&rev=539116&r1=539115&r2=539116
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/combobox.ftl (original)
+++ struts/struts2/branches/STRUTS_2_0_X/core/src/main/resources/template/simple/combobox.ftl Thu May 17 14:07:16 2007
@@ -1,5 +1,5 @@
<script type="text/javascript">
- function autoPopulate_${parameters.name?html}(targetElement) {
+ function autoPopulate_${parameters.id?html}(targetElement) {
<#if parameters.headerKey?exists && parameters.headerValue?exists>
if (targetElement.options[targetElement.selectedIndex].value == '${parameters.headerKey?html}') {
return;
@@ -16,7 +16,7 @@
<#include "/${parameters.templateDir}/simple/text.ftl" />
<br/>
<#if parameters.list?exists>
-<select onChange="autoPopulate_${parameters.name?html}(this);"<#rt/>
+<select onChange="autoPopulate_${parameters.id?html}(this);"<#rt/>
<#if parameters.disabled?default(false)>
disabled="disabled"<#rt/>
</#if>
Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java?view=diff&rev=539116&r1=539115&r2=539116
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java (original)
+++ struts/struts2/branches/STRUTS_2_0_X/core/src/test/java/org/apache/struts2/views/jsp/ui/ComboBoxTest.java Thu May 17 14:07:16 2007
@@ -78,6 +78,7 @@
tag.setPageContext(pageContext);
tag.setLabel("mylabel");
tag.setName("foo");
+ tag.setId("cb");
tag.setList("collection");
tag.doStartTag();
Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/test/resources/org/apache/struts2/views/jsp/ui/ComboBox-1.txt
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/test/resources/org/apache/struts2/views/jsp/ui/ComboBox-1.txt?view=diff&rev=539116&r1=539115&r2=539116
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/core/src/test/resources/org/apache/struts2/views/jsp/ui/ComboBox-1.txt (original)
+++ struts/struts2/branches/STRUTS_2_0_X/core/src/test/resources/org/apache/struts2/views/jsp/ui/ComboBox-1.txt Thu May 17 14:07:16 2007
@@ -1,13 +1,13 @@
<tr>
- <td class="tdLabel"><label for="foo" class="label">mylabel:</label></td>
+ <td class="tdLabel"><label for="cb" class="label">mylabel:</label></td>
<td>
<script type="text/javascript">
- function autoPopulate_foo(targetElement) {
+ function autoPopulate_cb(targetElement) {
targetElement.form.elements['foo'].value=targetElement.options[targetElement.selectedIndex].value;
}
</script>
-<input type="text" name="foo" value="hello" id="foo"/><br/>
-<select onChange="autoPopulate_foo(this);">
+<input type="text" name="foo" value="hello" id="cb"/><br/>
+<select onChange="autoPopulate_cb(this);">
<option value="foo">foo</option>
<option value="bar">bar</option>
<option value="baz">baz</option>