[ 
https://issues.apache.org/jira/browse/WICKET-3449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergey Plevko updated WICKET-3449:
----------------------------------

          Description: 
When we add a first child to the root node junction link (near the root) 
doesn't appear in the tree. 
This bug easily can be reproduced with the next piece of code.


TestPage.html 

<html xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>
<body>
<table>
    <tr>        <td>            <div wicket:id="tree"></div>        </td>    
</tr>
    <tr>        <td>            <input type="submit" wicket:id="addChild" 
class="btn btnStd" />        </td>    </tr>
</table>
</body>
</html>

TestPage.java

public class TestPage extends WebPage {
    public TestPage() {
        final DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");

        final DefaultTreeModel treeModel = new DefaultTreeModel(root);
        final BaseTree tree = new LinkTree("tree", treeModel);

        add(tree);
        tree.getTreeState().expandNode(root);

        AjaxLink addButton = new AjaxLink("addChild") {
            public void onClick(AjaxRequestTarget ajaxRequestTarget) {
                DefaultMutableTreeNode child = new 
DefaultMutableTreeNode("child");
                root.add(child); // it doesn't matter how we add this child
                treeModel.insertNodeInto(child, root, 0);
                tree.updateTree(ajaxRequestTarget);
            }
        };
        add(addButton);
    }
}

  was:
When we add a first child to the node this update doesn't appeare in a browser. 
If we collapse/expand this the parent node forced we will see changes. All the 
rest updates work correctly.
This bug easily can be reproduced with the next pice of code.


TestPage.html 

<html xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>
<body>
<table>
    <tr>        <td>            <div wicket:id="tree"></div>        </td>    
</tr>
    <tr>        <td>            <input type="submit" wicket:id="addChild" 
class="btn btnStd" />        </td>    </tr>
</table>
</body>
</html>

TestPage.java

public class TestPage extends WebPage {
    public TestPage() {
        DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
        final DefaultMutableTreeNode rootChild = new 
DefaultMutableTreeNode("rootChild");
        root.add(rootChild);

        final DefaultTreeModel treeModel = new DefaultTreeModel(root);
        final BaseTree tree = new LinkTree("tree", treeModel);

        add(tree);
        tree.getTreeState().expandNode(root);

        AjaxLink addButton = new AjaxLink("addChild") {
            public void onClick(AjaxRequestTarget ajaxRequestTarget) {
                DefaultMutableTreeNode child = new 
DefaultMutableTreeNode("child");
                //rootChild.add(child); // it doesn't matter how we add this 
child
                treeModel.insertNodeInto(child, rootChild, 0);
                tree.updateTree(ajaxRequestTarget);
            }
        };
        add(addButton);
    }
}


          Environment: tomcat 6.0.26, win 7  (was: tomcat 6.0.14, win 7)
    Affects Version/s:     (was: 1.4.8)
                       1.4.14

> Tree doesn't update correctly
> -----------------------------
>
>                 Key: WICKET-3449
>                 URL: https://issues.apache.org/jira/browse/WICKET-3449
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.14
>         Environment: tomcat 6.0.26, win 7
>            Reporter: Sergey Plevko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.11, 1.5-M2.1
>
>
> When we add a first child to the root node junction link (near the root) 
> doesn't appear in the tree. 
> This bug easily can be reproduced with the next piece of code.
> TestPage.html 
> <html xmlns="http://www.w3.org/1999/xhtml"; 
> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>
> <body>
> <table>
>     <tr>        <td>            <div wicket:id="tree"></div>        </td>    
> </tr>
>     <tr>        <td>            <input type="submit" wicket:id="addChild" 
> class="btn btnStd" />        </td>    </tr>
> </table>
> </body>
> </html>
> TestPage.java
> public class TestPage extends WebPage {
>     public TestPage() {
>         final DefaultMutableTreeNode root = new 
> DefaultMutableTreeNode("root");
>         final DefaultTreeModel treeModel = new DefaultTreeModel(root);
>         final BaseTree tree = new LinkTree("tree", treeModel);
>         add(tree);
>         tree.getTreeState().expandNode(root);
>         AjaxLink addButton = new AjaxLink("addChild") {
>             public void onClick(AjaxRequestTarget ajaxRequestTarget) {
>                 DefaultMutableTreeNode child = new 
> DefaultMutableTreeNode("child");
>                 root.add(child); // it doesn't matter how we add this child
>                 treeModel.insertNodeInto(child, root, 0);
>                 tree.updateTree(ajaxRequestTarget);
>             }
>         };
>         add(addButton);
>     }
> }

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to