henning     2003/11/07 07:17:01

  Modified:    src/java/org/apache/turbine/services/intake/model Tag:
                        TURBINE_2_3_BRANCH Field.java
               xdocs    Tag: TURBINE_2_3_BRANCH changes.xml
  Log:
  Add a new method called getHTMLString() which returns the value of the field
  suitable to be used inside an <input type="text" value="$!frm.get("Foo")">
  HTML input tag. If the form value contains double quotes ("), then the value
  will screw up the field. This can now be avoided by using the following
  expression: <input type="text" value="$!frm.get("Foo").HTMLString">
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.15.2.7  +15 -1     
jakarta-turbine-2/src/java/org/apache/turbine/services/intake/model/Field.java
  
  Index: Field.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/intake/model/Field.java,v
  retrieving revision 1.15.2.6
  retrieving revision 1.15.2.7
  diff -u -r1.15.2.6 -r1.15.2.7
  --- Field.java        1 Oct 2003 06:16:13 -0000       1.15.2.6
  +++ Field.java        7 Nov 2003 15:17:01 -0000       1.15.2.7
  @@ -833,6 +833,20 @@
       }
   
       /**
  +     * Calls toString() on the object returned by getValue(),
  +     * unless null; and then it returns "", the empty String.
  +     * Escapes &quot; characters to be able to display these
  +     * in HTML form fields.
  +     *
  +     * @return a <code>String</code> value
  +     */
  +    public String getHTMLString()
  +    {
  +        String res = toString();
  +        return StringUtils.replace(res, "\"", "&quot;");
  +    }
  +
  +    /**
        * Loads the valid value from a bean
        *
        * @throws IntakeException indicates a problem during the execution of the
  
  
  
  No                   revision
  No                   revision
  1.60.2.10 +11 -0     jakarta-turbine-2/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/xdocs/changes.xml,v
  retrieving revision 1.60.2.9
  retrieving revision 1.60.2.10
  diff -u -r1.60.2.9 -r1.60.2.10
  --- changes.xml       31 Oct 2003 01:20:43 -0000      1.60.2.9
  +++ changes.xml       7 Nov 2003 15:17:01 -0000       1.60.2.10
  @@ -62,6 +62,17 @@
   Changes between Turbine 2.3 and 2.3.1.
   </p>
   
  +<subsection name="Other changes">
  +<p>
  +  <ul>
  +    <li>
  +      Intake was extended to provide Field values with &quot; escaped as
  +      &amp;quot; to provide valid values for HTML form inputs.
  +    </li>
  +  </ul>
  +</p>
  +</subsection>
  +
   <subsection name="Fixed bugs">
   <p>
     <ul>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to