You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2010/08/25 00:21:20 UTC

[jira] Resolved: (WICKET-2886) Tree doesn't update correctly

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

Igor Vaynberg resolved WICKET-2886.
-----------------------------------

    Fix Version/s: 1.4.11
                   1.5-M2
       Resolution: Fixed

> Tree doesn't update correctly
> -----------------------------
>
>                 Key: WICKET-2886
>                 URL: https://issues.apache.org/jira/browse/WICKET-2886
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.8
>         Environment: tomcat 6.0.14, win 7
>            Reporter: Sergey Plevko
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.11, 1.5-M2
>
>         Attachments: WICKET-2886-fix.patch, WICKET-2886-Quickstart.zip
>
>
> 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 MainTreeTestPage() {
>         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);
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.