Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-10771

Trim white-space characters by rendering of inputTextarea JSF tag

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • EAP_EWP 5.2.0
    • RichFaces
    • Hide
      1. unzip a TextAreaTest-app.zip under the <seam home in EAP 5>/examples/booking directory.
      2. Deploy seam booking example (execute "ant deploy" command under the above directory).
      3. Start default profile in EAP 5.
      4. Open the "http://localhost:8080/seam-booking/test.seam" on your web browser.
      5. Input following string value and push the submit button ("TEST" button).
        • Text-Area field = " a b c "
      6. You can confirm white-space characters in Text-Area field is trimmed by every submit.
        • submit => Text-Area field = " a b c "
        • => submit => Text-Area field = "a b c"
      Show
      unzip a TextAreaTest-app.zip under the <seam home in EAP 5>/examples/booking directory. Deploy seam booking example (execute "ant deploy" command under the above directory). Start default profile in EAP 5. Open the "http://localhost:8080/seam-booking/test.seam" on your web browser. Input following string value and push the submit button ("TEST" button). Text-Area field = " a b c " You can confirm white-space characters in Text-Area field is trimmed by every submit. submit => Text-Area field = " a b c " => submit => Text-Area field = "a b c"
    • Hide

      There is not workaround unless disabling filter in RichFaces configuration.

      Show
      There is not workaround unless disabling filter in RichFaces configuration.
    • NEW

    Description

      A value input into an inputTextarea of JSF tag is trimmed white-space characters automatically when data gets rendered in page.

      Trim handling for the inputTextarea is the following (org.ajax4jsf.org.w3c.tidy.ParserImpl.java)
      3115#    /**
      3116#     * Parser for text nodes.
      3117#     */
      3118#    public static class ParseText implements Parser
      3119#    {
      3120#
      3121#        /**
      3122#         * @see org.ajax4jsf.org.w3c.tidy.Parser#parse(org.ajax4jsf.org.w3c.tidy.Lexer, org.ajax4jsf.org.w3c.tidy.Node, short)
      3123#         */
      3124#        public void parse(Lexer lexer, Node field, short mode)
      --- snip ---
      3240#            while ((node = lexer.getToken(mode)) != null)
      3241#            {
      3242#                if (node.tag == field.tag && node.type == Node.END_TAG)
      3243#                {
      3244#                    field.closed = true;
      => 3245#                    Node.trimSpaces(lexer, field);
      3246#                    return;
      3247#                }
      3248#
      3249#                // deal with comments etc.
      3250#                if (Node.insertMisc(field, node))
      3251#                {
      3252#                    continue;
      3253#                }
      3254#
      3255#                if (node.type == Node.TEXT_NODE)
      3256#                {
      3257#                    // only called for 1st child
      3258#                    if (field.content == null && !((mode & Lexer.PREFORMATTED) != 0))
      3259#                    {
      3260#                        Node.trimSpaces(lexer, field);
      3261#                    }
      3262#
      3263#                    if (node.start >= node.end)
      3264#                    {
      3265#                        continue;
      3266#                    }
      3267#
      3269#                    field.insertNodeAtEnd(node);
      3270#                    continue;
      3271#                }
      ....
      

      Attachments

        Activity

          People

            bleathem@redhat.com Brian Leathem (Inactive)
            rhn-support-enagai Eiichi Nagai (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: