You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sebastiaan van Erk (JIRA)" <ji...@apache.org> on 2008/02/22 19:09:19 UTC

[jira] Created: (WICKET-1366) "ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree

"ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree
-------------------------------------------------------------------------------------------------

                 Key: WICKET-1366
                 URL: https://issues.apache.org/jira/browse/WICKET-1366
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.1
            Reporter: Sebastiaan van Erk


I'm trying to have a wicket LinkTree collapse and expand subtrees when I click on the respective nodes. I have the following code:

        tree = new LinkTree("tree", createTreeModel()) {
            @Override
            protected void onNodeLinkClicked(final TreeNode node, final BaseTree tree, final AjaxRequestTarget target) {
                if (!node.isLeaf()) {
                    if (tree.getTreeState().isNodeExpanded(node)) {
                        collapseAll(node);
                    } else {
                        expandAll(node);
                    }
                    tree.updateTree(target);
                } else {
                    System.out.println(Arrays.toString(((DefaultMutableTreeNode) node).getUserObjectPath()));
                }
            }
        };


with the methods expandAll/collapseAll as follows:

    protected void collapseAll(final TreeNode treeNode) {
        tree.getTreeState().collapseNode(treeNode);
        for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
            collapseAll((TreeNode) e.nextElement());
        }
    }

    protected void expandAll(final TreeNode treeNode) {
        tree.getTreeState().expandNode(treeNode);
        for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
            expandAll((TreeNode) e.nextElement());
        }
    }

However, I keep getting the following errors (specifically, this happens when I collapse a subtree first, and then collapse a subtree of which the other subtree is a sibling):

java.lang.IllegalStateException: No Page found for component [MarkupContainer [Component id = 200, page = <No Page>, path = 200.AbstractTree$TreeItem]]
     at org.apache.wicket.Component.getPage(Component.java:1639)
     at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:689)
     at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:605)
     at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520)
     at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
     at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1172)
     at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
     at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
     at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
     at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
     at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
     at java.lang.Thread.run(Thread.java:595)


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


[jira] Assigned: (WICKET-1366) "ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-1366:
-------------------------------------

    Assignee: Matej Knopp

> "ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree
> -------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1366
>                 URL: https://issues.apache.org/jira/browse/WICKET-1366
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>            Reporter: Sebastiaan van Erk
>            Assignee: Matej Knopp
>
> I'm trying to have a wicket LinkTree collapse and expand subtrees when I click on the respective nodes. I have the following code:
>         tree = new LinkTree("tree", createTreeModel()) {
>             @Override
>             protected void onNodeLinkClicked(final TreeNode node, final BaseTree tree, final AjaxRequestTarget target) {
>                 if (!node.isLeaf()) {
>                     if (tree.getTreeState().isNodeExpanded(node)) {
>                         collapseAll(node);
>                     } else {
>                         expandAll(node);
>                     }
>                     tree.updateTree(target);
>                 } else {
>                     System.out.println(Arrays.toString(((DefaultMutableTreeNode) node).getUserObjectPath()));
>                 }
>             }
>         };
> with the methods expandAll/collapseAll as follows:
>     protected void collapseAll(final TreeNode treeNode) {
>         tree.getTreeState().collapseNode(treeNode);
>         for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
>             collapseAll((TreeNode) e.nextElement());
>         }
>     }
>     protected void expandAll(final TreeNode treeNode) {
>         tree.getTreeState().expandNode(treeNode);
>         for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
>             expandAll((TreeNode) e.nextElement());
>         }
>     }
> However, I keep getting the following errors (specifically, this happens when I collapse a subtree first, and then collapse a subtree of which the other subtree is a sibling):
> java.lang.IllegalStateException: No Page found for component [MarkupContainer [Component id = 200, page = <No Page>, path = 200.AbstractTree$TreeItem]]
>      at org.apache.wicket.Component.getPage(Component.java:1639)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:689)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:605)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520)
>      at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
>      at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1172)
>      at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
>      at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
>      at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>      at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
>      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
>      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>      at java.lang.Thread.run(Thread.java:595)

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


[jira] Commented: (WICKET-1366) "ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree

Posted by "Kent Tong (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571732#action_12571732 ] 

Kent Tong commented on WICKET-1366:
-----------------------------------

The problem is in LinkIconPanel:

	protected void onNodeLinkClicked(TreeNode node, BaseTree tree, AjaxRequestTarget target)
	{
		tree.getTreeState().selectNode(node, !tree.getTreeState().isNodeSelected(node));
		tree.updateTree(target);
	}

In updateTree() some TreeItems are added to the request target but later they are removed because a subtree is collapsed. So, either not call updateTree() or make the AjaxRequestTarget more intelligent: skip those components that have been removed from the page.

> "ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree
> -------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1366
>                 URL: https://issues.apache.org/jira/browse/WICKET-1366
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>            Reporter: Sebastiaan van Erk
>            Assignee: Matej Knopp
>
> I'm trying to have a wicket LinkTree collapse and expand subtrees when I click on the respective nodes. I have the following code:
>         tree = new LinkTree("tree", createTreeModel()) {
>             @Override
>             protected void onNodeLinkClicked(final TreeNode node, final BaseTree tree, final AjaxRequestTarget target) {
>                 if (!node.isLeaf()) {
>                     if (tree.getTreeState().isNodeExpanded(node)) {
>                         collapseAll(node);
>                     } else {
>                         expandAll(node);
>                     }
>                     tree.updateTree(target);
>                 } else {
>                     System.out.println(Arrays.toString(((DefaultMutableTreeNode) node).getUserObjectPath()));
>                 }
>             }
>         };
> with the methods expandAll/collapseAll as follows:
>     protected void collapseAll(final TreeNode treeNode) {
>         tree.getTreeState().collapseNode(treeNode);
>         for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
>             collapseAll((TreeNode) e.nextElement());
>         }
>     }
>     protected void expandAll(final TreeNode treeNode) {
>         tree.getTreeState().expandNode(treeNode);
>         for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
>             expandAll((TreeNode) e.nextElement());
>         }
>     }
> However, I keep getting the following errors (specifically, this happens when I collapse a subtree first, and then collapse a subtree of which the other subtree is a sibling):
> java.lang.IllegalStateException: No Page found for component [MarkupContainer [Component id = 200, page = <No Page>, path = 200.AbstractTree$TreeItem]]
>      at org.apache.wicket.Component.getPage(Component.java:1639)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:689)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:605)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520)
>      at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
>      at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1172)
>      at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
>      at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
>      at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>      at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
>      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
>      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>      at java.lang.Thread.run(Thread.java:595)

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


[jira] Resolved: (WICKET-1366) "ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree

Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matej Knopp resolved WICKET-1366.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4-M2

> "ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree
> -------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1366
>                 URL: https://issues.apache.org/jira/browse/WICKET-1366
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>            Reporter: Sebastiaan van Erk
>            Assignee: Matej Knopp
>             Fix For: 1.4-M2
>
>
> I'm trying to have a wicket LinkTree collapse and expand subtrees when I click on the respective nodes. I have the following code:
>         tree = new LinkTree("tree", createTreeModel()) {
>             @Override
>             protected void onNodeLinkClicked(final TreeNode node, final BaseTree tree, final AjaxRequestTarget target) {
>                 if (!node.isLeaf()) {
>                     if (tree.getTreeState().isNodeExpanded(node)) {
>                         collapseAll(node);
>                     } else {
>                         expandAll(node);
>                     }
>                     tree.updateTree(target);
>                 } else {
>                     System.out.println(Arrays.toString(((DefaultMutableTreeNode) node).getUserObjectPath()));
>                 }
>             }
>         };
> with the methods expandAll/collapseAll as follows:
>     protected void collapseAll(final TreeNode treeNode) {
>         tree.getTreeState().collapseNode(treeNode);
>         for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
>             collapseAll((TreeNode) e.nextElement());
>         }
>     }
>     protected void expandAll(final TreeNode treeNode) {
>         tree.getTreeState().expandNode(treeNode);
>         for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
>             expandAll((TreeNode) e.nextElement());
>         }
>     }
> However, I keep getting the following errors (specifically, this happens when I collapse a subtree first, and then collapse a subtree of which the other subtree is a sibling):
> java.lang.IllegalStateException: No Page found for component [MarkupContainer [Component id = 200, page = <No Page>, path = 200.AbstractTree$TreeItem]]
>      at org.apache.wicket.Component.getPage(Component.java:1639)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:689)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:605)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520)
>      at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
>      at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1172)
>      at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
>      at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
>      at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>      at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
>      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
>      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>      at java.lang.Thread.run(Thread.java:595)

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


[jira] Commented: (WICKET-1366) "ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree

Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571744#action_12571744 ] 

Matej Knopp commented on WICKET-1366:
-------------------------------------

Hi, the check in AjaxRequestTarget is intentional. Problem is that the tree update should be called only once during request before the actual render. I'll see if I can do that automatic somehow.

> "ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree
> -------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1366
>                 URL: https://issues.apache.org/jira/browse/WICKET-1366
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>            Reporter: Sebastiaan van Erk
>            Assignee: Matej Knopp
>
> I'm trying to have a wicket LinkTree collapse and expand subtrees when I click on the respective nodes. I have the following code:
>         tree = new LinkTree("tree", createTreeModel()) {
>             @Override
>             protected void onNodeLinkClicked(final TreeNode node, final BaseTree tree, final AjaxRequestTarget target) {
>                 if (!node.isLeaf()) {
>                     if (tree.getTreeState().isNodeExpanded(node)) {
>                         collapseAll(node);
>                     } else {
>                         expandAll(node);
>                     }
>                     tree.updateTree(target);
>                 } else {
>                     System.out.println(Arrays.toString(((DefaultMutableTreeNode) node).getUserObjectPath()));
>                 }
>             }
>         };
> with the methods expandAll/collapseAll as follows:
>     protected void collapseAll(final TreeNode treeNode) {
>         tree.getTreeState().collapseNode(treeNode);
>         for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
>             collapseAll((TreeNode) e.nextElement());
>         }
>     }
>     protected void expandAll(final TreeNode treeNode) {
>         tree.getTreeState().expandNode(treeNode);
>         for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
>             expandAll((TreeNode) e.nextElement());
>         }
>     }
> However, I keep getting the following errors (specifically, this happens when I collapse a subtree first, and then collapse a subtree of which the other subtree is a sibling):
> java.lang.IllegalStateException: No Page found for component [MarkupContainer [Component id = 200, page = <No Page>, path = 200.AbstractTree$TreeItem]]
>      at org.apache.wicket.Component.getPage(Component.java:1639)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:689)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:605)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520)
>      at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
>      at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1172)
>      at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
>      at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
>      at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>      at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
>      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
>      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>      at java.lang.Thread.run(Thread.java:595)

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


[jira] Updated: (WICKET-1366) "ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-1366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Compagner updated WICKET-1366:
------------------------------------

    Fix Version/s: 1.3.4

> "ava.lang.IllegalStateException: No Page found for component" when collapsing nodes in a LinkTree
> -------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-1366
>                 URL: https://issues.apache.org/jira/browse/WICKET-1366
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.1
>            Reporter: Sebastiaan van Erk
>            Assignee: Matej Knopp
>             Fix For: 1.3.4, 1.4-M2
>
>
> I'm trying to have a wicket LinkTree collapse and expand subtrees when I click on the respective nodes. I have the following code:
>         tree = new LinkTree("tree", createTreeModel()) {
>             @Override
>             protected void onNodeLinkClicked(final TreeNode node, final BaseTree tree, final AjaxRequestTarget target) {
>                 if (!node.isLeaf()) {
>                     if (tree.getTreeState().isNodeExpanded(node)) {
>                         collapseAll(node);
>                     } else {
>                         expandAll(node);
>                     }
>                     tree.updateTree(target);
>                 } else {
>                     System.out.println(Arrays.toString(((DefaultMutableTreeNode) node).getUserObjectPath()));
>                 }
>             }
>         };
> with the methods expandAll/collapseAll as follows:
>     protected void collapseAll(final TreeNode treeNode) {
>         tree.getTreeState().collapseNode(treeNode);
>         for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
>             collapseAll((TreeNode) e.nextElement());
>         }
>     }
>     protected void expandAll(final TreeNode treeNode) {
>         tree.getTreeState().expandNode(treeNode);
>         for (final Enumeration e = treeNode.children(); e.hasMoreElements();) {
>             expandAll((TreeNode) e.nextElement());
>         }
>     }
> However, I keep getting the following errors (specifically, this happens when I collapse a subtree first, and then collapse a subtree of which the other subtree is a sibling):
> java.lang.IllegalStateException: No Page found for component [MarkupContainer [Component id = 200, page = <No Page>, path = 200.AbstractTree$TreeItem]]
>      at org.apache.wicket.Component.getPage(Component.java:1639)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:689)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:605)
>      at org.apache.wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:520)
>      at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
>      at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1172)
>      at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
>      at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
>      at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
>      at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
>      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
>      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>      at java.lang.Thread.run(Thread.java:595)

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