svn commit: r447901 - in /struts/struts2/trunk/core/src: main/resources/template/simple/select.ftl test/java/org/apache/struts2/views/jsp/ui/SelectTest.java test/resources/org/apache/struts2/views/jsp

2006-09-19 Thread tmjee
Author: tmjee
Date: Tue Sep 19 09:36:02 2006
New Revision: 447901

URL: http://svn.apache.org/viewvc?view=rev&rev=447901
Log:
WW-1449 
  Select Component does not preselect header



Added:

struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Select-8.txt
Modified:
struts/struts2/trunk/core/src/main/resources/template/simple/select.ftl

struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/SelectTest.java

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?view=diff&rev=447901&r1=447900&r2=447901
==
--- struts/struts2/trunk/core/src/main/resources/template/simple/select.ftl 
(original)
+++ struts/struts2/trunk/core/src/main/resources/template/simple/select.ftl Tue 
Sep 19 09:36:02 2006
@@ -28,7 +28,11 @@
 <#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
 >
 <#if parameters.headerKey?exists && parameters.headerValue?exists>
-${parameters.headerValue?html}
+
+selected="selected"
+
+>${parameters.headerValue?html}
 
 <#if parameters.emptyOption?default(false)>
 

Modified: 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/SelectTest.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/SelectTest.java?view=diff&rev=447901&r1=447900&r2=447901
==
--- 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/SelectTest.java
 (original)
+++ 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ui/SelectTest.java
 Tue Sep 19 09:36:02 2006
@@ -29,6 +29,23 @@
 /**
  */
 public class SelectTest extends AbstractUITagTest {
+   
+   
+   public void testHeaderCanBePreselected() throws Exception {
+   SelectTag tag = new SelectTag();
+   tag.setPageContext(pageContext);
+   tag.setLabel("myLabel");
+   tag.setList("#{1:'Cat',2:'Dog'}");
+   tag.setName("myPet");
+   tag.setHeaderKey("-1");
+   tag.setHeaderValue("--- Please Select ---");
+   tag.setValue("%{'-1'}");
+   
+   tag.doStartTag();
+   tag.doEndTag();
+   
+   verify(SelectTag.class.getResource("Select-8.txt"));
+   }
 
 /**
  * Tests WW-455: Select tag template does not work properly for Object 
like BigDecimal.

Added: 
struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Select-8.txt
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Select-8.txt?view=auto&rev=447901
==
--- 
struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Select-8.txt
 (added)
+++ 
struts/struts2/trunk/core/src/test/resources/org/apache/struts2/views/jsp/ui/Select-8.txt
 Tue Sep 19 09:36:02 2006
@@ -0,0 +1,10 @@
+
+myLabel:
+
+
+--- Please Select ---
+Cat
+Dog
+
+
+
\ No newline at end of file




[Struts Wiki] Update of "ActionErrorsAndActionMessages" by MichaelJouravlev

2006-09-19 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Struts Wiki" for change 
notification.

The following page has been changed by MichaelJouravlev:
http://wiki.apache.org/struts/ActionErrorsAndActionMessages

The comment on the change is:
Fixed paths to source repository

--
  [http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html 
details] on the differences between html:messages and html:errors on his 
website.
  
  I hope this helps to clarify things.  I would strongly encourage people to 
have a look inside the Struts source code, as it's really quite clear when you 
look under the hood.  You can see what happens in validation by examining the 
"processValidate" method in RequestProcessor:
- 
http://svn.apache.org/viewvc/struts/action/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java?view=markup
+ 
http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java?view=markup
  
  You can see what happens with saveErrors and saveMessages by examining those 
methods in Action
- 
http://svn.apache.org/viewvc/struts/action/trunk/core/src/main/java/org/apache/struts/action/Action.java?view=markup
+ 
http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/Action.java?view=markup
  
  You can see what the tags do by looking at their respective source files:
- 
http://svn.apache.org/viewvc/struts/action/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java?view=markup
+ 
http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java?view=markup
- 
http://svn.apache.org/viewvc/struts/action/trunk/taglib/src/main/java/org/apache/struts/taglib/html/ErrorsTag.java?view=markup
+ 
http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/ErrorsTag.java?view=markup