ICEfaces
  1. ICEfaces
  2. ICE-3807

When I collapse a tree-node, it's icon doesn't move.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.7.2, 1.8DR#1
    • Fix Version/s: 1.8
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows Vista, Firefox 3.0, Jboss 4.2.3

      Description

      When a tree with a node with sub-nodes is created, in the source you can see a end line between the two images. This end line create a litle space between the two pictuce as you can see in the capture 1 of the showcase. For example in the tree of the iceFaces showcase at the first generation of the code :
      <div ...> <img src="tree_line_blank.gif"/> <a ...><img src="tree_nav_middle_close.gif" alt=""/></a>
      <div ...><img src="tree_folder_open.gif" .../></div>
      <div ...><a ...><span ...>Western</span></a></div>

      But now if you collapse and expand this same node, the code became :
      <div ...> <img src="tree_line_blank.gif"/> <a ...><img src="tree_nav_middle_close.gif" alt=""/></a><div ...><img src="tree_folder_open.gif" .../></div><div ...><a ...><span ...>Western</span></a></div>

      With the absence of end line, the space disappear and the icon in the tree move a little as you can see in the capture 2 of the showcase.
      1. DOMUtils.java
        28 kB
        Stephan Anft
      2. TreeRenderer.java
        30 kB
        Krashan Brahmanjara
      1. bad_tree.JPG
        12 kB
      2. err.PNG
        3 kB
      3. Nodes with children aren't aligned horizontally.jpg
        6 kB
      4. ScreenHunter_01 Mar. 26 13.59.jpg
        146 kB
      5. screenshot-1.jpg
        3 kB
      6. screenshot-2.jpg
        2 kB
      7. tree_folder_closed.gif
        1.0 kB

        Activity

        Hide
        Loïc Villanné added a comment -

        At the firts generation, you can see a little space created by the end line between the two balise

        Show
        Loïc Villanné added a comment - At the firts generation, you can see a little space created by the end line between the two balise
        Hide
        Loïc Villanné added a comment -

        After a collapse and an expand of the node, the code is generated without endline between the two balise. The little space was destroyed between the two pictures.

        Show
        Loïc Villanné added a comment - After a collapse and an expand of the node, the code is generated without endline between the two balise. The little space was destroyed between the two pictures.
        Hide
        David Popa added a comment - - edited

        I confirm the Issue also on Windows XP, FF 3.0 and IE6, and Tomcat 5.5.2x. It is present both in 1.7.0 and 1.7.1., but not in 1.6.2.
        When the end-user expands/collapses a couple of nodes (he uses a little bit his application) the result is quite messy (see in bad_tree.jpg).

        Show
        David Popa added a comment - - edited I confirm the Issue also on Windows XP, FF 3.0 and IE6, and Tomcat 5.5.2x. It is present both in 1.7.0 and 1.7.1., but not in 1.6.2. When the end-user expands/collapses a couple of nodes (he uses a little bit his application) the result is quite messy (see in bad_tree.jpg).
        Hide
        Stephan Anft added a comment -

        We have the same problem with the tree in a current project. After some investigation, it seems like the source of the problem is the line break handling in the DOMUtils class. Line breaks are processed differently for

        (a) the children of the root node for the current DOM rendering and
        (b) their children (= grandchildren of the root node).

        The result is the behaviour described above: The first time the tree is rendered, the content of the tree nodes is handled like (b) because the root node of the rendering process is usually outside of the tree. Anyhow, as soon as a node is expanded, the content of the expanded tree node is handled like (a) because now the expanded node is the root node.

        We have patched the DOMUtils class in order to adjust the line break handling. I have attached the modified source file. As far as I can see the problem is solved.

        Please note that the changed DOMUtils class is based on the ICEFaces 1.7.2SP1 release so it may not fix the problem in other releases.

        Show
        Stephan Anft added a comment - We have the same problem with the tree in a current project. After some investigation, it seems like the source of the problem is the line break handling in the DOMUtils class. Line breaks are processed differently for (a) the children of the root node for the current DOM rendering and (b) their children (= grandchildren of the root node). The result is the behaviour described above: The first time the tree is rendered, the content of the tree nodes is handled like (b) because the root node of the rendering process is usually outside of the tree. Anyhow, as soon as a node is expanded, the content of the expanded tree node is handled like (a) because now the expanded node is the root node. We have patched the DOMUtils class in order to adjust the line break handling. I have attached the modified source file. As far as I can see the problem is solved. Please note that the changed DOMUtils class is based on the ICEFaces 1.7.2SP1 release so it may not fix the problem in other releases.
        Hide
        Adam Hurkala added a comment -

        Works ok now, hopefully the patch can be applied in upcoming 1.8.0 version.

        Show
        Adam Hurkala added a comment - Works ok now, hopefully the patch can be applied in upcoming 1.8.0 version.
        Hide
        Ezio Di Nisio added a comment -

        We have try this path on icefaces 1.7.2.3 ....and don't work.

        This is a very noise problem for our application....
        ....we hope that icefaces 1.8 fix this issue.

        ciao

        Show
        Ezio Di Nisio added a comment - We have try this path on icefaces 1.7.2.3 ....and don't work. This is a very noise problem for our application.... ....we hope that icefaces 1.8 fix this issue. ciao
        Hide
        Krashan Brahmanjara added a comment -

        Please. Describe that fix and show in diif ">"/"<" format on Jira

        Show
        Krashan Brahmanjara added a comment - Please. Describe that fix and show in diif ">"/"<" format on Jira
        Hide
        Krashan Brahmanjara added a comment -

        Error confirmed on 1.8.0 RC2

        Show
        Krashan Brahmanjara added a comment - Error confirmed on 1.8.0 RC2
        Hide
        Christophe Taverne added a comment -

        Hi,

        I get this bug too with last SVN rév.

        regards,

        Show
        Christophe Taverne added a comment - Hi, I get this bug too with last SVN rév. regards,
        Hide
        Krashan Brahmanjara added a comment -

        The problem is probably associated with java 1.6 or tomcat.
        In ouput page I see sometimes malformed line end signs - instead 0A0D there are sometimes 0A0D0A, 0A or only 0D

        Quick total fix is in DomUtils.java disable line with [ writer.write("\n"); ].

        Another good fix is patch of TreeRenderer.java at row 433

        (431) navAnchor.setAttribute(HTML.ONCLICK_ATTR, onclickString);
        treeNodeDiv.appendChild(navAnchor);
        > repair new line problem in component-showcase main menu
        > Text space = domContext.createTextNode(" ");
        > treeNodeDiv.appendChild(space);
        // icon

        Above patch do not resolve problem with line breaking between icon and label in tree example from component-showcase.

        Also file tree_folder_closed.gif in rime style got invalid size. Patch in attachment

        Show
        Krashan Brahmanjara added a comment - The problem is probably associated with java 1.6 or tomcat. In ouput page I see sometimes malformed line end signs - instead 0A0D there are sometimes 0A0D0A, 0A or only 0D Quick total fix is in DomUtils.java disable line with [ writer.write("\n"); ]. Another good fix is patch of TreeRenderer.java at row 433 (431) navAnchor.setAttribute(HTML.ONCLICK_ATTR, onclickString); treeNodeDiv.appendChild(navAnchor); > repair new line problem in component-showcase main menu > Text space = domContext.createTextNode(" "); > treeNodeDiv.appendChild(space); // icon Above patch do not resolve problem with line breaking between icon and label in tree example from component-showcase. Also file tree_folder_closed.gif in rime style got invalid size. Patch in attachment
        Hide
        Krashan Brahmanjara added a comment -

        Corrected tree_folder_closed.gif for rime style

        Show
        Krashan Brahmanjara added a comment - Corrected tree_folder_closed.gif for rime style
        Hide
        Krashan Brahmanjara added a comment -

        Patched TreeRenderer

        Show
        Krashan Brahmanjara added a comment - Patched TreeRenderer
        Hide
        Krashan Brahmanjara added a comment -

        BTW
        Patch of DomUtils.java from attachment of Stephen Anpf is not necessary.

        Show
        Krashan Brahmanjara added a comment - BTW Patch of DomUtils.java from attachment of Stephen Anpf is not necessary.
        Hide
        Christophe Taverne added a comment - - edited

        Hi,

        a part of bug still remains on last SVN rev: 18662.

        Nodes with children and nodes without children that are not aligned horizontally. A space character is always here into the generated code.

        We can't see this case on the component showcase. So please, see my new attached picture.

        regards,

        Show
        Christophe Taverne added a comment - - edited Hi, a part of bug still remains on last SVN rev: 18662. Nodes with children and nodes without children that are not aligned horizontally. A space character is always here into the generated code. We can't see this case on the component showcase. So please, see my new attached picture. regards,
        Hide
        Christophe Taverne added a comment - - edited

        Problem with icons horizontal align.
        See "test2" node that have children and other nodes.

        Show
        Christophe Taverne added a comment - - edited Problem with icons horizontal align. See "test2" node that have children and other nodes.
        Hide
        yip.ng added a comment -

        As this doesn't occur in component showcase anymore, it will be harder to debug and test. Please provide a simple test app. if possible.

        Show
        yip.ng added a comment - As this doesn't occur in component showcase anymore, it will be harder to debug and test. Please provide a simple test app. if possible.
        Hide
        Christophe Taverne added a comment - - edited

        Re,

        It doesn't occur in component showcase anymore simply because there isn't any node without children under the nodes with children into your example
        So we can't see this case.

        So simply add a node without children into the demo tree of component showcase and you will reproduce the problem as mentioned on this screen capture: http://jira.icefaces.org/secure/attachment/11633/Nodes+with+children+aren%27t+aligned+horizontally.jpg

        Thanks.

        regards

        Show
        Christophe Taverne added a comment - - edited Re, It doesn't occur in component showcase anymore simply because there isn't any node without children under the nodes with children into your example So we can't see this case. So simply add a node without children into the demo tree of component showcase and you will reproduce the problem as mentioned on this screen capture: http://jira.icefaces.org/secure/attachment/11633/Nodes+with+children+aren%27t+aligned+horizontally.jpg Thanks. regards
        Hide
        yip.ng added a comment -

        Fixed. See ScreenHunter_01 Mar. 26 13.59.jpg.

        Show
        yip.ng added a comment - Fixed. See ScreenHunter_01 Mar. 26 13.59.jpg.
        Hide
        Christophe Taverne added a comment -

        Perfect! Thanks a lot for your work.

        regards,

        Show
        Christophe Taverne added a comment - Perfect! Thanks a lot for your work. regards,

          People

          • Assignee:
            Unassigned
            Reporter:
            Loïc Villanné
          • Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: