ICEfaces
  1. ICEfaces
  2. ICE-1351

newline emitted after </input>

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: 1.6.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      firefox 2.0/winxp, facelets

      Description

      Icefaces renderer appears to append a newline character after </input> element resulting in gaps between commandButtons rendered next to each other. Not entirely sure where this happens but suspecting DOMUtils.printNode method.

      Check out screens (before and after generated source was manually-edited to remove the newline). also attaching sample xhtml file and button image

        Activity

        dukehoops created issue -
        dukehoops made changes -
        Field Original Value New Value
        Attachment page as generated - note gap between buttons, newline in source.jpg [ 10331 ]
        Hide
        dukehoops added a comment -

        before and after screens added

        -nikita

        Show
        dukehoops added a comment - before and after screens added -nikita
        dukehoops made changes -
        Hide
        dukehoops added a comment -

        image used in commandButton

        -nikita

        Show
        dukehoops added a comment - image used in commandButton -nikita
        dukehoops made changes -
        Attachment nav_Home.gif [ 10333 ]
        Hide
        dukehoops added a comment -

        test case

        -nikita

        Show
        dukehoops added a comment - test case -nikita
        dukehoops made changes -
        Attachment buttons.xhtml [ 10334 ]
        Hide
        dukehoops added a comment -

        Seems like the root maybe here (DOMUtils):

                      if (children != null) {
                            int childrenLength = children.getLength();
                            for (int i = 0; i < childrenLength; i++) {
                                boolean childAddTrailingNewline = false;
                                if (allowAddingWhitespace) {
                                    if ((i + 1) < childrenLength) {
                                        Node nextChild = children.item(i + 1);
                                        // We don't add the newline if the next tag is a TD,
                                        // because when rendering our tabbedPane, if there's
                                        // any whitespace between the adjacent TDs, then
                                        // Internet Explorer will add vertical spacing
                                        childAddTrailingNewline =
                                                !isWhitespaceText(nextChild) &&
                                                !isTD(nextChild);
                                    }
                                }
                                printNode(children.item(i), stringbuffer, depth + 1,
                                          allowAddingWhitespace,
                                          childAddTrailingNewline);
                            }
                        }
        

        When ice:form is being rendered, after rendering the first child (button1), childAddTrailingNewline is evaluated to true before button2 is rendered.

        Is this needed for pretty-printing?

        Show
        dukehoops added a comment - Seems like the root maybe here (DOMUtils): if (children != null) { int childrenLength = children.getLength(); for (int i = 0; i < childrenLength; i++) { boolean childAddTrailingNewline = false; if (allowAddingWhitespace) { if ((i + 1) < childrenLength) { Node nextChild = children.item(i + 1); // We don't add the newline if the next tag is a TD, // because when rendering our tabbedPane, if there's // any whitespace between the adjacent TDs, then // Internet Explorer will add vertical spacing childAddTrailingNewline = !isWhitespaceText(nextChild) && !isTD(nextChild); } } printNode(children.item(i), stringbuffer, depth + 1, allowAddingWhitespace, childAddTrailingNewline); } } When ice:form is being rendered, after rendering the first child (button1), childAddTrailingNewline is evaluated to true before button2 is rendered. Is this needed for pretty-printing?
        Hide
        dukehoops added a comment -

        this is worked around by wrapping buttons in a table with 0 cellpadding, cellspacing:

        <ice:panelGrid columns="2" cellspacing="0" cellpadding="0"/>

        Show
        dukehoops added a comment - this is worked around by wrapping buttons in a table with 0 cellpadding, cellspacing: <ice:panelGrid columns="2" cellspacing="0" cellpadding="0"/>
        Philip Breau made changes -
        Support Case References https://www.icesoft.ca:4443/supportilla/show_bug.cgi?id=3982
        Support Customer Ref. #s 703
        Philip Breau made changes -
        Assignee Philip Breau [ philip.breau ]
        Philip Breau made changes -
        Assignee Philip Breau [ philip.breau ] Adnan Durrani [ adnan.durrani ]
        Ken Fyten made changes -
        Fix Version/s 1.6.1 [ 10070 ]
        Ken Fyten made changes -
        Assignee Adnan Durrani [ adnan.durrani ] Yip Ng [ yip.ng ]
        Ken Fyten made changes -
        Assignee Priority P1
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #14652 Tue Aug 14 13:03:46 MDT 2007 yip.ng ICE-1351
        Added code to not emit newline after <input> field, to avoid an extra space.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/util/DOMUtils.java
        Hide
        yip.ng added a comment -

        Code added to not emit the newline.

        Show
        yip.ng added a comment - Code added to not emit the newline.
        Hide
        yip.ng added a comment -

        Test webapp.

        Note: before running the webapp, add the relevant jars to the WEB-INF/lib dir, including icefaces.jar, where the code change will be compiled into.

        Show
        yip.ng added a comment - Test webapp. Note: before running the webapp, add the relevant jars to the WEB-INF/lib dir, including icefaces.jar, where the code change will be compiled into.
        yip.ng made changes -
        Attachment test.zip [ 10598 ]
        Hide
        yip.ng added a comment -

        Fixed by adding code to not emit the newline. Test webapp attached.

        Show
        yip.ng added a comment - Fixed by adding code to not emit the newline. Test webapp attached.
        yip.ng made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Adnan Durrani added a comment -

        The following posting says that if there is a new line character between two img elements, the browsers renders a space between them.

        http://www.icefaces.org/JForum/posts/list/5397.page

        Show
        Adnan Durrani added a comment - The following posting says that if there is a new line character between two img elements, the browsers renders a space between them. http://www.icefaces.org/JForum/posts/list/5397.page
        Adnan Durrani made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #14691 Mon Aug 20 17:32:31 MDT 2007 yip.ng ICE-1351
        Added <img> to list of tags not allowed to output newline.
        Merged and re-factored methods checking tag types and names.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/util/DOMUtils.java
        Hide
        yip.ng added a comment -

        Updated test web app. with testing of <img> tag included.

        Show
        yip.ng added a comment - Updated test web app. with testing of <img> tag included.
        yip.ng made changes -
        Attachment ICE-1351.war [ 10622 ]
        Hide
        yip.ng added a comment -

        Included <img> tag in the list of tags not to output newline.
        Also merged and re-factored methods checking node types and node names.

        Show
        yip.ng added a comment - Included <img> tag in the list of tags not to output newline. Also merged and re-factored methods checking node types and node names.
        yip.ng made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P1
        Assignee Yip Ng [ yip.ng ]

          People

          • Assignee:
            Unassigned
            Reporter:
            dukehoops
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: