Revision: 401
          http://svn.sourceforge.net/stripes/?rev=401&view=rev
Author:   tfenne
Date:     2006-09-02 08:33:27 -0700 (Sat, 02 Sep 2006)

Log Message:
-----------
Fix for STS-254: Text areas appearing to eat leading newlines on repopulation

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/tag/InputTextAreaTag.java

Modified: trunk/stripes/src/net/sourceforge/stripes/tag/InputTextAreaTag.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/InputTextAreaTag.java 
2006-09-02 13:11:19 UTC (rev 400)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/InputTextAreaTag.java 
2006-09-02 15:33:27 UTC (rev 401)
@@ -87,12 +87,20 @@
     public int doEndInputTag() throws JspException {
         try {
             // Find out if we have a value from the PopulationStrategy
-            Object value   = getSingleOverrideValue();
+            Object value = getSingleOverrideValue();
 
             writeOpenTag(getPageContext().getOut(), "textarea");
 
             // Write out the contents of the text area
             if (value != null) {
+                // Most browsers have this annoying habit of eating the first 
newline
+                // in a textarea tag. Since this is probably not desired, 
sometimes
+                // we need to add an extra newline into the output before the 
value
+                String body = getBodyContentAsString();
+                if (body == null || !body.equals(value)) {
+                    getPageContext().getOut().write('\n');
+                }
+
                 getPageContext().getOut().write( 
HtmlUtil.encode(format(value)) );
             }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to