Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

nino martinez wael
Hi
In wicket 6 this worked, there are another input field (ajax activated)
that triggers the update :

   ChildAwareNestedTree profilePartitionTree = new
ChildAwareNestedTree("skillsetSelect", provider, sharedExpansionState)
{

            @Override
            protected Component newContentComponent(String id,
IModel<TreeNode> model) {

                TreeNode node = model.getObject();

                if (node instanceof TreeNodeProvider.PartitionNode) {
                    Partition partition =
((TreeNodeProvider.PartitionNode) node).getPartition();
                    if
(getPartitionsWithProfiles().containsKey(partition.getId())) {*
                expand(node);*
                    }
                } else if (node instanceof
TreeNodeProvider.NoPartitionNode && isNoPartitionProfilesPresent()) {*
                   expand(node);*
                }

....}

The triggering field:

        searchTerm.add(new AjaxFormComponentUpdatingBehavior("keydown") {

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                if (searchTermModel.getObject() != null &&
!searchTermModel.getObject().isEmpty()) {
                    profilePartitionTree.rebuildExpandedPartitions();
                } else {
                    profilePartitionTree.getPartitionsWithProfiles().clear();
                }*                target.add(profilePartitionTree);*

            }

            @Override
            protected void updateAjaxAttributes(AjaxRequestAttributes
attributes) {
                super.updateAjaxAttributes(attributes);
                attributes.setThrottlingSettings(new
ThrottlingSettings(searchTerm.getMarkupId(),
Duration.milliseconds(400), true));
            }

        });


But I get an  this error message in wicket 8, my line below:

2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 |
DefaultExceptionMapper           | 136 - org.apache.wicket.core - 8.1.0 |
Unexpected error occurred

org.apache.wicket.WicketRuntimeException: Error attaching this container
for rendering: [Subtree [Component id = subtree]]

                             at
org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]

                             at
dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01]

                             at
org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0]

                             at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6(<generated>)[jar:bundle://128.0:0/!/:]

                             at
org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke(<generated>)[jar:bundle://128.0:0/!/:]

                             at
net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]

                             at
org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]

                             at
org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle(<generated>)[jar:bundle://128.0:0/!/:]

                             at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3(<generated>)[jar:bundle://128.0:0/!/:]

                             at
org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke(<generated>)[jar:bundle://128.0:0/!/:]

                             at
net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]

                             at
org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]

                             at
org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter(<generated>)[jar:bundle://128.0:0/!/:]

                             at
org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0]

                             at
org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0]

                             at
org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0]

                             at
org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0]

                             at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]

                             at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]

                             at
org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120]

                             at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]

                             at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]

                             at
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]

                             at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120]

                             at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120]

                             at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120]

                             at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120]

                             at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]

                             at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]

                             at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120]

                             at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120]

                             at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120]

                             at
org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]

                             at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.eclipse.jetty.server:9.2.21.v20170120]

                             at
org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]

                             at
org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120]

                             at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120]

                             at
org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)[73:org.eclipse.jetty.io:9
.2.21.v20170120]

                             at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120]

                             at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120]

                             at java.lang.Thread.run(Unknown
Source)[:1.8.0_111]

Caused by: java.lang.IllegalStateException: Components can no  longer be
added

                             at
org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122)

                             at
org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115)

                             at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]

                             at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]

                             at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]

                             at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]

                             at
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114)

                             at
org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0]

                             at java.util.Optional.ifPresent(Unknown
Source)[:1.8.0_111]

                             at
org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0]

                            * at
dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]*

                             at
org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0]

                             at
org.apache.wicket.extensions.markup.html.repeater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0]

                             at
org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]

                             at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]

                             at
org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0]

                             at
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.MarkupContainer.addedComponent(MarkupContainer.java:1014)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]

                             at
org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]

                             ... 56 more


--
Best regards / Med venlig hilsen
Nino Martinez
Reply | Threaded
Open this post in threaded view
|

Re: Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

Sven Meier
 
 
Hi Nino,
 

 
during rendering of components no additional components can be added to the ART any more.
 
I surprised that your code worked in 6.x, can you build a quickstart demonstrating the problem?
 

 
Have fun
 
Sven
 

 

 
 
 
 
 
>  
> On 28.11.2018 at 14:38,  <nino martinez wael>  wrote:
>  
>  
>  Hi In wicket 6 this worked, there are another input field (ajax activated) that triggers the update : ChildAwareNestedTree profilePartitionTree = new ChildAwareNestedTree("skillsetSelect", provider, sharedExpansionState) { @Override protected Component newContentComponent(String id, IModel model) { TreeNode node = model.getObject(); if (node instanceof TreeNodeProvider.PartitionNode) { Partition partition = ((TreeNodeProvider.PartitionNode) node).getPartition(); if (getPartitionsWithProfiles().containsKey(partition.getId())) {* expand(node);* } } else if (node instanceof TreeNodeProvider.NoPartitionNode  &&  isNoPartitionProfilesPresent()) {* expand(node);* } ....} The triggering field: searchTerm.add(new AjaxFormComponentUpdatingBehavior("keydown") { @Override protected void onUpdate(AjaxRequestTarget target) { if (searchTermModel.getObject() != null  &&  !searchTermModel.getObject().isEmpty()) { profilePartitionTree.rebuildExpandedPartitions(); } else { profilePartitionTree.getP
artitionsWithProfiles().clear(); }* target.add(profilePartitionTree);* } @Override protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { super.updateAjaxAttributes(attributes); attributes.setThrottlingSettings(new ThrottlingSettings(searchTerm.getMarkupId(), Duration.milliseconds(400), true)); } }); But I get an this error message in wicket 8, my line below: 2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 | DefaultExceptionMapper | 136 - org.apache.wicket.core - 8.1.0 | Unexpected error occurred org.apache.wicket.WicketRuntimeException: Error attaching this container for rendering: [Subtree [Component id = subtree]] at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.MarkupContai
ner.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0] at dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01] at org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apa
che.wicket.core:8.1.0] at org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0] at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]  at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6()[jar:bundle://128.0:0/!/:] at org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:] at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servic
emix.bundles.cglib:2.2.2.1] at org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0] at org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle()[jar:bundle://128.0:0/!/:] at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3()[jar:bundle://128.0:0/!/:] at org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:] at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1] at org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.int
ercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0] at org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter()[jar:bundle://128.0:0/!/:] at org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0] at org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0] at org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0] at org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120] at o
rg.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120] at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120] at org.eclipse.jetty.server.handler.Con
textHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120] at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120] at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.e
clipse.jetty.server:9.2.21.v20170120] at org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]   at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120] at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)[73:org.eclipse.jetty.io:9 .2.21.v20170120] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120] at java.lang.Thread.run(Unknown Source)[:1.8.0_111] Caused by: java.lang.IllegalStateException: Components can no longer be added at org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wick
et.core:8.1.0] at org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122) at org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115) at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0] a
t org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0] at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114) at org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0] at java.util.Optional.ifPresent(Unknown Source)[:1.8.0_111]   at org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0] * at dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]* at org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0] at org.apache.wicket.extensions.markup.html.repe
ater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0] at org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0] at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.MarkupContainer.addedComponent(Mark
upContainer.java:1014)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0] at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0] ... 56 more -- Best regards / Med venlig hilsen Nino Martinez
>  
     
Reply | Threaded
Open this post in threaded view
|

Re: Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

nino martinez wael
Yes I understand.. Let me see if it breaks in wicket examples, or I can
make it so.. Do you know another way to make a node/folder expand during
construction time? Feels like the expand method are meant for ajax calls
only.

-regards Nino

On Wed, Nov 28, 2018 at 4:16 PM sven <[hidden email]> wrote:

>
>
> Hi Nino,
>
>
>
> during rendering of components no additional components can be added to
> the ART any more.
>
> I surprised that your code worked in 6.x, can you build a quickstart
> demonstrating the problem?
>
>
>
> Have fun
>
> Sven
>
>
>
>
>
>
>
>
>
> >
> > On 28.11.2018 at 14:38,  <nino martinez wael>  wrote:
> >
> >
> >  Hi In wicket 6 this worked, there are another input field (ajax
> activated) that triggers the update : ChildAwareNestedTree
> profilePartitionTree = new ChildAwareNestedTree("skillsetSelect", provider,
> sharedExpansionState) { @Override protected Component
> newContentComponent(String id, IModel model) { TreeNode node =
> model.getObject(); if (node instanceof TreeNodeProvider.PartitionNode) {
> Partition partition = ((TreeNodeProvider.PartitionNode)
> node).getPartition(); if
> (getPartitionsWithProfiles().containsKey(partition.getId())) {*
> expand(node);* } } else if (node instanceof
> TreeNodeProvider.NoPartitionNode  &&  isNoPartitionProfilesPresent()) {*
> expand(node);* } ....} The triggering field: searchTerm.add(new
> AjaxFormComponentUpdatingBehavior("keydown") { @Override protected void
> onUpdate(AjaxRequestTarget target) { if (searchTermModel.getObject() !=
> null  &&  !searchTermModel.getObject().isEmpty()) {
> profilePartitionTree.rebuildExpandedPartitions(); } else {
> profilePartitionTree.getP
> artitionsWithProfiles().clear(); }* target.add(profilePartitionTree);* }
> @Override protected void updateAjaxAttributes(AjaxRequestAttributes
> attributes) { super.updateAjaxAttributes(attributes);
> attributes.setThrottlingSettings(new
> ThrottlingSettings(searchTerm.getMarkupId(), Duration.milliseconds(400),
> true)); } }); But I get an this error message in wicket 8, my line below:
> 2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 | DefaultExceptionMapper
> | 136 - org.apache.wicket.core - 8.1.0 | Unexpected error occurred
> org.apache.wicket.WicketRuntimeException: Error attaching this container
> for rendering: [Subtree [Component id = subtree]] at
> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> at org.apache.wicket.MarkupContai
> ner.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
> at
> dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01]
> at
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apa
> che.wicket.core:8.1.0] at
> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0]
> at
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6()[jar:bundle://128.0:0/!/:]
> at
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
> at
> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servic
> emix.bundles.cglib:2.2.2.1] at
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
> at
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle()[jar:bundle://128.0:0/!/:]
> at
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3()[jar:bundle://128.0:0/!/:]
> at
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
> at
> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]
> at
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.int
> ercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
> at
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter()[jar:bundle://128.0:0/!/:]
> at
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0]
> at
> org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0]
> at
> org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0]
> at
> org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0]
> at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> at o
> rg.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120]
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120]
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> at org.eclipse.jetty.server.handler.Con
> textHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> at
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.e
> clipse.jetty.server:9.2.21.v20170120] at
> org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>  at
> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> at org.eclipse.jetty.io
> .AbstractConnection$2.run(AbstractConnection.java:544)[73:
> org.eclipse.jetty.io:9 .2.21.v20170120] at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120]
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120]
> at java.lang.Thread.run(Unknown Source)[:1.8.0_111] Caused by:
> java.lang.IllegalStateException: Components can no longer be added at
> org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wick
> et.core:8.1.0] at
> org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122)
> at
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115)
> at
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
> at
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
> at
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
> a
> t
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
> at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114)
> at
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0]
> at java.util.Optional.ifPresent(Unknown Source)[:1.8.0_111]   at
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0]
> * at
> dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]*
> at
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0]
> at org.apache.wicket.extensions.markup.html.repe
> ater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0]
> at
> org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
> at
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
> at
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0]
> at
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0]
> at org.apache.wicket.MarkupContainer.addedComponent(Mark
> upContainer.java:1014)[136:org.apache.wicket.core:8.1.0] at
> org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> at
> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
> ... 56 more -- Best regards / Med venlig hilsen Nino Martinez
> >
>



--
Best regards / Med venlig hilsen
Nino Martinez
Reply | Threaded
Open this post in threaded view
|

Re: Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

nino martinez wael
currently unable to reproduce in examples, something must be wrong in my
code..

I'll comeback if it turns out otherwise..

Thanks for helping :)

On Thu, Nov 29, 2018 at 6:54 AM nino martinez wael <
[hidden email]> wrote:

> Yes I understand.. Let me see if it breaks in wicket examples, or I can
> make it so.. Do you know another way to make a node/folder expand during
> construction time? Feels like the expand method are meant for ajax calls
> only.
>
> -regards Nino
>
> On Wed, Nov 28, 2018 at 4:16 PM sven <[hidden email]> wrote:
>
>>
>>
>> Hi Nino,
>>
>>
>>
>> during rendering of components no additional components can be added to
>> the ART any more.
>>
>> I surprised that your code worked in 6.x, can you build a quickstart
>> demonstrating the problem?
>>
>>
>>
>> Have fun
>>
>> Sven
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> >
>> > On 28.11.2018 at 14:38,  <nino martinez wael>  wrote:
>> >
>> >
>> >  Hi In wicket 6 this worked, there are another input field (ajax
>> activated) that triggers the update : ChildAwareNestedTree
>> profilePartitionTree = new ChildAwareNestedTree("skillsetSelect", provider,
>> sharedExpansionState) { @Override protected Component
>> newContentComponent(String id, IModel model) { TreeNode node =
>> model.getObject(); if (node instanceof TreeNodeProvider.PartitionNode) {
>> Partition partition = ((TreeNodeProvider.PartitionNode)
>> node).getPartition(); if
>> (getPartitionsWithProfiles().containsKey(partition.getId())) {*
>> expand(node);* } } else if (node instanceof
>> TreeNodeProvider.NoPartitionNode  &&  isNoPartitionProfilesPresent()) {*
>> expand(node);* } ....} The triggering field: searchTerm.add(new
>> AjaxFormComponentUpdatingBehavior("keydown") { @Override protected void
>> onUpdate(AjaxRequestTarget target) { if (searchTermModel.getObject() !=
>> null  &&  !searchTermModel.getObject().isEmpty()) {
>> profilePartitionTree.rebuildExpandedPartitions(); } else {
>> profilePartitionTree.getP
>> artitionsWithProfiles().clear(); }* target.add(profilePartitionTree);* }
>> @Override protected void updateAjaxAttributes(AjaxRequestAttributes
>> attributes) { super.updateAjaxAttributes(attributes);
>> attributes.setThrottlingSettings(new
>> ThrottlingSettings(searchTerm.getMarkupId(), Duration.milliseconds(400),
>> true)); } }); But I get an this error message in wicket 8, my line below:
>> 2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 | DefaultExceptionMapper
>> | 136 - org.apache.wicket.core - 8.1.0 | Unexpected error occurred
>> org.apache.wicket.WicketRuntimeException: Error attaching this container
>> for rendering: [Subtree [Component id = subtree]] at
>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>> at org.apache.wicket.MarkupContai
>> ner.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>> at
>> dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01]
>> at
>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apa
>> che.wicket.core:8.1.0] at
>> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0]
>> at
>> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6()[jar:bundle://128.0:0/!/:]
>> at
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>> at
>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servic
>> emix.bundles.cglib:2.2.2.1] at
>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>> at
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle()[jar:bundle://128.0:0/!/:]
>> at
>> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3()[jar:bundle://128.0:0/!/:]
>> at
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>> at
>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]
>> at
>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.int
>> ercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>> at
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter()[jar:bundle://128.0:0/!/:]
>> at
>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0]
>> at
>> org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0]
>> at
>> org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0]
>> at
>> org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0]
>> at
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>> at
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>> at o
>> rg.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120]
>> at
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>> at
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>> at
>> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>> at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>> at
>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120]
>> at
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>> at org.eclipse.jetty.server.handler.Con
>> textHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>> at
>> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>> at
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>> at
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>> at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>> at
>> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>> at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.e
>> clipse.jetty.server:9.2.21.v20170120] at
>> org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>  at
>> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>> at
>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>> at org.eclipse.jetty.io
>> .AbstractConnection$2.run(AbstractConnection.java:544)[73:
>> org.eclipse.jetty.io:9 .2.21.v20170120] at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>> at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>> at java.lang.Thread.run(Unknown Source)[:1.8.0_111] Caused by:
>> java.lang.IllegalStateException: Components can no longer be added at
>> org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wick
>> et.core:8.1.0] at
>> org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122)
>> at
>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115)
>> at
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>> at
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>> at
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>> a
>> t
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>> at
>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114)
>> at
>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0]
>> at java.util.Optional.ifPresent(Unknown Source)[:1.8.0_111]   at
>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0]
>> * at
>> dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]*
>> at
>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0]
>> at org.apache.wicket.extensions.markup.html.repe
>> ater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0]
>> at
>> org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>> at
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>> at
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0]
>> at
>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0]
>> at org.apache.wicket.MarkupContainer.addedComponent(Mark
>> upContainer.java:1014)[136:org.apache.wicket.core:8.1.0] at
>> org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>> at
>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>> ... 56 more -- Best regards / Med venlig hilsen Nino Martinez
>> >
>>
>
>
>
> --
> Best regards / Med venlig hilsen
> Nino Martinez
>


--
Best regards / Med venlig hilsen
Nino Martinez
Reply | Threaded
Open this post in threaded view
|

Re: Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

nino martinez wael
I've debugged a lot further. But still unable to pinpoint it.. For now I've
switched to rendering the full page instead, which of course works.

We are a couple of things in conjunction with TREE, like wicket jquery ui
draggable and droppable.. We also have a custom loading mechanism that pops
a veil if the request are too long to load.. And some custom form handling
aswell (auto show an marker for error'd form fields)..

PS writing this for other to see, if they hit  this challenge..

-Regards Nino


On Thu, Nov 29, 2018 at 8:50 AM nino martinez wael <
[hidden email]> wrote:

> currently unable to reproduce in examples, something must be wrong in my
> code..
>
> I'll comeback if it turns out otherwise..
>
> Thanks for helping :)
>
> On Thu, Nov 29, 2018 at 6:54 AM nino martinez wael <
> [hidden email]> wrote:
>
>> Yes I understand.. Let me see if it breaks in wicket examples, or I can
>> make it so.. Do you know another way to make a node/folder expand during
>> construction time? Feels like the expand method are meant for ajax calls
>> only.
>>
>> -regards Nino
>>
>> On Wed, Nov 28, 2018 at 4:16 PM sven <[hidden email]> wrote:
>>
>>>
>>>
>>> Hi Nino,
>>>
>>>
>>>
>>> during rendering of components no additional components can be added to
>>> the ART any more.
>>>
>>> I surprised that your code worked in 6.x, can you build a quickstart
>>> demonstrating the problem?
>>>
>>>
>>>
>>> Have fun
>>>
>>> Sven
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> >
>>> > On 28.11.2018 at 14:38,  <nino martinez wael>  wrote:
>>> >
>>> >
>>> >  Hi In wicket 6 this worked, there are another input field (ajax
>>> activated) that triggers the update : ChildAwareNestedTree
>>> profilePartitionTree = new ChildAwareNestedTree("skillsetSelect", provider,
>>> sharedExpansionState) { @Override protected Component
>>> newContentComponent(String id, IModel model) { TreeNode node =
>>> model.getObject(); if (node instanceof TreeNodeProvider.PartitionNode) {
>>> Partition partition = ((TreeNodeProvider.PartitionNode)
>>> node).getPartition(); if
>>> (getPartitionsWithProfiles().containsKey(partition.getId())) {*
>>> expand(node);* } } else if (node instanceof
>>> TreeNodeProvider.NoPartitionNode  &&  isNoPartitionProfilesPresent()) {*
>>> expand(node);* } ....} The triggering field: searchTerm.add(new
>>> AjaxFormComponentUpdatingBehavior("keydown") { @Override protected void
>>> onUpdate(AjaxRequestTarget target) { if (searchTermModel.getObject() !=
>>> null  &&  !searchTermModel.getObject().isEmpty()) {
>>> profilePartitionTree.rebuildExpandedPartitions(); } else {
>>> profilePartitionTree.getP
>>> artitionsWithProfiles().clear(); }* target.add(profilePartitionTree);* }
>>> @Override protected void updateAjaxAttributes(AjaxRequestAttributes
>>> attributes) { super.updateAjaxAttributes(attributes);
>>> attributes.setThrottlingSettings(new
>>> ThrottlingSettings(searchTerm.getMarkupId(), Duration.milliseconds(400),
>>> true)); } }); But I get an this error message in wicket 8, my line below:
>>> 2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 | DefaultExceptionMapper
>>> | 136 - org.apache.wicket.core - 8.1.0 | Unexpected error occurred
>>> org.apache.wicket.WicketRuntimeException: Error attaching this container
>>> for rendering: [Subtree [Component id = subtree]] at
>>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>> at org.apache.wicket.MarkupContai
>>> ner.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01]
>>> at
>>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apa
>>> che.wicket.core:8.1.0] at
>>> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0]
>>> at
>>> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6()[jar:bundle://128.0:0/!/:]
>>> at
>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>>> at
>>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servic
>>> emix.bundles.cglib:2.2.2.1] at
>>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>>> at
>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle()[jar:bundle://128.0:0/!/:]
>>> at
>>> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3()[jar:bundle://128.0:0/!/:]
>>> at
>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>>> at
>>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]
>>> at
>>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.int
>>> ercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>>> at
>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter()[jar:bundle://128.0:0/!/:]
>>> at
>>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0]
>>> at
>>> org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0]
>>> at
>>> org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0]
>>> at
>>> org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0]
>>> at
>>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>> at
>>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>> at o
>>> rg.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120]
>>> at
>>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>> at
>>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>> at
>>> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>> at
>>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>> at
>>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120]
>>> at
>>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>> at org.eclipse.jetty.server.handler.Con
>>> textHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>> at
>>> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>> at
>>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>> at
>>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>> at
>>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>> at
>>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>> at
>>> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>> at
>>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.e
>>> clipse.jetty.server:9.2.21.v20170120] at
>>> org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>  at
>>> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>> at
>>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>> at org.eclipse.jetty.io
>>> .AbstractConnection$2.run(AbstractConnection.java:544)[73:
>>> org.eclipse.jetty.io:9 .2.21.v20170120] at
>>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>>> at
>>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>>> at java.lang.Thread.run(Unknown Source)[:1.8.0_111] Caused by:
>>> java.lang.IllegalStateException: Components can no longer be added at
>>> org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wick
>>> et.core:8.1.0] at
>>> org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122)
>>> at
>>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115)
>>> at
>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>>> at
>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>>> at
>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>>> a
>>> t
>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>>> at
>>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114)
>>> at
>>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0]
>>> at java.util.Optional.ifPresent(Unknown Source)[:1.8.0_111]   at
>>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0]
>>> * at
>>> dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]*
>>> at
>>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0]
>>> at org.apache.wicket.extensions.markup.html.repe
>>> ater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0]
>>> at
>>> org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>>> at
>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>>> at
>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0]
>>> at
>>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0]
>>> at org.apache.wicket.MarkupContainer.addedComponent(Mark
>>> upContainer.java:1014)[136:org.apache.wicket.core:8.1.0] at
>>> org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>> at
>>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>>> ... 56 more -- Best regards / Med venlig hilsen Nino Martinez
>>> >
>>>
>>
>>
>>
>> --
>> Best regards / Med venlig hilsen
>> Nino Martinez
>>
>
>
> --
> Best regards / Med venlig hilsen
> Nino Martinez
>


--
Best regards / Med venlig hilsen
Nino Martinez
Reply | Threaded
Open this post in threaded view
|

Re: Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

nino martinez wael
@[hidden email] <[hidden email]> what/how do I need to check
during the call? For now I have a breakpoint the place in the code where it
fails, but I need to figure out what closes the request target..

On Mon, Dec 3, 2018 at 10:55 AM nino martinez wael <
[hidden email]> wrote:

> I've debugged a lot further. But still unable to pinpoint it.. For now
> I've switched to rendering the full page instead, which of course works.
>
> We are a couple of things in conjunction with TREE, like wicket jquery ui
> draggable and droppable.. We also have a custom loading mechanism that pops
> a veil if the request are too long to load.. And some custom form handling
> aswell (auto show an marker for error'd form fields)..
>
> PS writing this for other to see, if they hit  this challenge..
>
> -Regards Nino
>
>
> On Thu, Nov 29, 2018 at 8:50 AM nino martinez wael <
> [hidden email]> wrote:
>
>> currently unable to reproduce in examples, something must be wrong in my
>> code..
>>
>> I'll comeback if it turns out otherwise..
>>
>> Thanks for helping :)
>>
>> On Thu, Nov 29, 2018 at 6:54 AM nino martinez wael <
>> [hidden email]> wrote:
>>
>>> Yes I understand.. Let me see if it breaks in wicket examples, or I can
>>> make it so.. Do you know another way to make a node/folder expand during
>>> construction time? Feels like the expand method are meant for ajax calls
>>> only.
>>>
>>> -regards Nino
>>>
>>> On Wed, Nov 28, 2018 at 4:16 PM sven <[hidden email]> wrote:
>>>
>>>>
>>>>
>>>> Hi Nino,
>>>>
>>>>
>>>>
>>>> during rendering of components no additional components can be added to
>>>> the ART any more.
>>>>
>>>> I surprised that your code worked in 6.x, can you build a quickstart
>>>> demonstrating the problem?
>>>>
>>>>
>>>>
>>>> Have fun
>>>>
>>>> Sven
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> >
>>>> > On 28.11.2018 at 14:38,  <nino martinez wael>  wrote:
>>>> >
>>>> >
>>>> >  Hi In wicket 6 this worked, there are another input field (ajax
>>>> activated) that triggers the update : ChildAwareNestedTree
>>>> profilePartitionTree = new ChildAwareNestedTree("skillsetSelect", provider,
>>>> sharedExpansionState) { @Override protected Component
>>>> newContentComponent(String id, IModel model) { TreeNode node =
>>>> model.getObject(); if (node instanceof TreeNodeProvider.PartitionNode) {
>>>> Partition partition = ((TreeNodeProvider.PartitionNode)
>>>> node).getPartition(); if
>>>> (getPartitionsWithProfiles().containsKey(partition.getId())) {*
>>>> expand(node);* } } else if (node instanceof
>>>> TreeNodeProvider.NoPartitionNode  &&  isNoPartitionProfilesPresent()) {*
>>>> expand(node);* } ....} The triggering field: searchTerm.add(new
>>>> AjaxFormComponentUpdatingBehavior("keydown") { @Override protected void
>>>> onUpdate(AjaxRequestTarget target) { if (searchTermModel.getObject() !=
>>>> null  &&  !searchTermModel.getObject().isEmpty()) {
>>>> profilePartitionTree.rebuildExpandedPartitions(); } else {
>>>> profilePartitionTree.getP
>>>> artitionsWithProfiles().clear(); }* target.add(profilePartitionTree);*
>>>> } @Override protected void updateAjaxAttributes(AjaxRequestAttributes
>>>> attributes) { super.updateAjaxAttributes(attributes);
>>>> attributes.setThrottlingSettings(new
>>>> ThrottlingSettings(searchTerm.getMarkupId(), Duration.milliseconds(400),
>>>> true)); } }); But I get an this error message in wicket 8, my line below:
>>>> 2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 | DefaultExceptionMapper
>>>> | 136 - org.apache.wicket.core - 8.1.0 | Unexpected error occurred
>>>> org.apache.wicket.WicketRuntimeException: Error attaching this container
>>>> for rendering: [Subtree [Component id = subtree]] at
>>>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>> at org.apache.wicket.MarkupContai
>>>> ner.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01]
>>>> at
>>>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apa
>>>> che.wicket.core:8.1.0] at
>>>> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0]
>>>> at
>>>> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6()[jar:bundle://128.0:0/!/:]
>>>> at
>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>>>> at
>>>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servic
>>>> emix.bundles.cglib:2.2.2.1] at
>>>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>> at
>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle()[jar:bundle://128.0:0/!/:]
>>>> at
>>>> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3()[jar:bundle://128.0:0/!/:]
>>>> at
>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>>>> at
>>>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]
>>>> at
>>>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.int
>>>> ercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>> at
>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter()[jar:bundle://128.0:0/!/:]
>>>> at
>>>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>> at
>>>> org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>> at
>>>> org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>> at
>>>> org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>> at
>>>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>> at
>>>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>> at o
>>>> rg.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120]
>>>> at
>>>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>> at
>>>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>> at
>>>> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>> at
>>>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>> at
>>>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120]
>>>> at
>>>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>> at org.eclipse.jetty.server.handler.Con
>>>> textHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>> at
>>>> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>> at
>>>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>> at
>>>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>> at
>>>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>> at
>>>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>> at
>>>> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>> at
>>>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.e
>>>> clipse.jetty.server:9.2.21.v20170120] at
>>>> org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>  at
>>>> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>> at
>>>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>> at org.eclipse.jetty.io
>>>> .AbstractConnection$2.run(AbstractConnection.java:544)[73:
>>>> org.eclipse.jetty.io:9 .2.21.v20170120] at
>>>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>>>> at
>>>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>>>> at java.lang.Thread.run(Unknown Source)[:1.8.0_111] Caused by:
>>>> java.lang.IllegalStateException: Components can no longer be added at
>>>> org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wick
>>>> et.core:8.1.0] at
>>>> org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122)
>>>> at
>>>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115)
>>>> at
>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>>>> at
>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>>>> at
>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>>>> a
>>>> t
>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>>>> at
>>>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114)
>>>> at
>>>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0]
>>>> at java.util.Optional.ifPresent(Unknown Source)[:1.8.0_111]   at
>>>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0]
>>>> * at
>>>> dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]*
>>>> at
>>>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0]
>>>> at org.apache.wicket.extensions.markup.html.repe
>>>> ater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0]
>>>> at
>>>> org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>>>> at
>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>>>> at
>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0]
>>>> at
>>>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0]
>>>> at org.apache.wicket.MarkupContainer.addedComponent(Mark
>>>> upContainer.java:1014)[136:org.apache.wicket.core:8.1.0] at
>>>> org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>> at
>>>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>>>> ... 56 more -- Best regards / Med venlig hilsen Nino Martinez
>>>> >
>>>>
>>>
>>>
>>>
>>> --
>>> Best regards / Med venlig hilsen
>>> Nino Martinez
>>>
>>
>>
>> --
>> Best regards / Med venlig hilsen
>> Nino Martinez
>>
>
>
> --
> Best regards / Med venlig hilsen
> Nino Martinez
>


--
Best regards / Med venlig hilsen
Nino Martinez
Reply | Threaded
Open this post in threaded view
|

Re: Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

Sven Meier
Hi,

the stacktrace shows clearly that you add a component to the ART while
it is already rendering the response.
This is not allowed, and this wasn't allowed in previous version.

You'll have to provide a quickstart to prove that it worked previously.

Regards
Sven

Am 06.12.18 um 13:50 schrieb nino martinez wael:

> @[hidden email] <[hidden email]> what/how do I need to check
> during the call? For now I have a breakpoint the place in the code where it
> fails, but I need to figure out what closes the request target..
>
> On Mon, Dec 3, 2018 at 10:55 AM nino martinez wael <
> [hidden email]> wrote:
>
>> I've debugged a lot further. But still unable to pinpoint it.. For now
>> I've switched to rendering the full page instead, which of course works.
>>
>> We are a couple of things in conjunction with TREE, like wicket jquery ui
>> draggable and droppable.. We also have a custom loading mechanism that pops
>> a veil if the request are too long to load.. And some custom form handling
>> aswell (auto show an marker for error'd form fields)..
>>
>> PS writing this for other to see, if they hit  this challenge..
>>
>> -Regards Nino
>>
>>
>> On Thu, Nov 29, 2018 at 8:50 AM nino martinez wael <
>> [hidden email]> wrote:
>>
>>> currently unable to reproduce in examples, something must be wrong in my
>>> code..
>>>
>>> I'll comeback if it turns out otherwise..
>>>
>>> Thanks for helping :)
>>>
>>> On Thu, Nov 29, 2018 at 6:54 AM nino martinez wael <
>>> [hidden email]> wrote:
>>>
>>>> Yes I understand.. Let me see if it breaks in wicket examples, or I can
>>>> make it so.. Do you know another way to make a node/folder expand during
>>>> construction time? Feels like the expand method are meant for ajax calls
>>>> only.
>>>>
>>>> -regards Nino
>>>>
>>>> On Wed, Nov 28, 2018 at 4:16 PM sven <[hidden email]> wrote:
>>>>
>>>>>
>>>>> Hi Nino,
>>>>>
>>>>>
>>>>>
>>>>> during rendering of components no additional components can be added to
>>>>> the ART any more.
>>>>>
>>>>> I surprised that your code worked in 6.x, can you build a quickstart
>>>>> demonstrating the problem?
>>>>>
>>>>>
>>>>>
>>>>> Have fun
>>>>>
>>>>> Sven
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> On 28.11.2018 at 14:38,  <nino martinez wael>  wrote:
>>>>>>
>>>>>>
>>>>>>   Hi In wicket 6 this worked, there are another input field (ajax
>>>>> activated) that triggers the update : ChildAwareNestedTree
>>>>> profilePartitionTree = new ChildAwareNestedTree("skillsetSelect", provider,
>>>>> sharedExpansionState) { @Override protected Component
>>>>> newContentComponent(String id, IModel model) { TreeNode node =
>>>>> model.getObject(); if (node instanceof TreeNodeProvider.PartitionNode) {
>>>>> Partition partition = ((TreeNodeProvider.PartitionNode)
>>>>> node).getPartition(); if
>>>>> (getPartitionsWithProfiles().containsKey(partition.getId())) {*
>>>>> expand(node);* } } else if (node instanceof
>>>>> TreeNodeProvider.NoPartitionNode  &&  isNoPartitionProfilesPresent()) {*
>>>>> expand(node);* } ....} The triggering field: searchTerm.add(new
>>>>> AjaxFormComponentUpdatingBehavior("keydown") { @Override protected void
>>>>> onUpdate(AjaxRequestTarget target) { if (searchTermModel.getObject() !=
>>>>> null  &&  !searchTermModel.getObject().isEmpty()) {
>>>>> profilePartitionTree.rebuildExpandedPartitions(); } else {
>>>>> profilePartitionTree.getP
>>>>> artitionsWithProfiles().clear(); }* target.add(profilePartitionTree);*
>>>>> } @Override protected void updateAjaxAttributes(AjaxRequestAttributes
>>>>> attributes) { super.updateAjaxAttributes(attributes);
>>>>> attributes.setThrottlingSettings(new
>>>>> ThrottlingSettings(searchTerm.getMarkupId(), Duration.milliseconds(400),
>>>>> true)); } }); But I get an this error message in wicket 8, my line below:
>>>>> 2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 | DefaultExceptionMapper
>>>>> | 136 - org.apache.wicket.core - 8.1.0 | Unexpected error occurred
>>>>> org.apache.wicket.WicketRuntimeException: Error attaching this container
>>>>> for rendering: [Subtree [Component id = subtree]] at
>>>>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>>> at org.apache.wicket.MarkupContai
>>>>> ner.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01]
>>>>> at
>>>>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apa
>>>>> che.wicket.core:8.1.0] at
>>>>> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0]
>>>>> at
>>>>> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6()[jar:bundle://128.0:0/!/:]
>>>>> at
>>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>>>>> at
>>>>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servic
>>>>> emix.bundles.cglib:2.2.2.1] at
>>>>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>> at
>>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle()[jar:bundle://128.0:0/!/:]
>>>>> at
>>>>> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3()[jar:bundle://128.0:0/!/:]
>>>>> at
>>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>>>>> at
>>>>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]
>>>>> at
>>>>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.int
>>>>> ercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>> at
>>>>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter()[jar:bundle://128.0:0/!/:]
>>>>> at
>>>>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>> at
>>>>> org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>> at
>>>>> org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>> at
>>>>> org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>> at
>>>>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>> at
>>>>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>> at o
>>>>> rg.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120]
>>>>> at
>>>>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>> at
>>>>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>> at
>>>>> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>>> at
>>>>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>> at
>>>>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120]
>>>>> at
>>>>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>> at org.eclipse.jetty.server.handler.Con
>>>>> textHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>> at
>>>>> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>>> at
>>>>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>> at
>>>>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>> at
>>>>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>> at
>>>>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>> at
>>>>> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>>> at
>>>>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.e
>>>>> clipse.jetty.server:9.2.21.v20170120] at
>>>>> org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>   at
>>>>> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>> at
>>>>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>> at org.eclipse.jetty.io
>>>>> .AbstractConnection$2.run(AbstractConnection.java:544)[73:
>>>>> org.eclipse.jetty.io:9 .2.21.v20170120] at
>>>>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>>>>> at
>>>>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>>>>> at java.lang.Thread.run(Unknown Source)[:1.8.0_111] Caused by:
>>>>> java.lang.IllegalStateException: Components can no longer be added at
>>>>> org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wick
>>>>> et.core:8.1.0] at
>>>>> org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122)
>>>>> at
>>>>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115)
>>>>> at
>>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>>>>> at
>>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>>>>> at
>>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>>>>> a
>>>>> t
>>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>>>>> at
>>>>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114)
>>>>> at
>>>>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0]
>>>>> at java.util.Optional.ifPresent(Unknown Source)[:1.8.0_111]   at
>>>>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0]
>>>>> * at
>>>>> dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]*
>>>>> at
>>>>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0]
>>>>> at org.apache.wicket.extensions.markup.html.repe
>>>>> ater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0]
>>>>> at
>>>>> org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>>>>> at
>>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>>>>> at
>>>>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0]
>>>>> at
>>>>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0]
>>>>> at org.apache.wicket.MarkupContainer.addedComponent(Mark
>>>>> upContainer.java:1014)[136:org.apache.wicket.core:8.1.0] at
>>>>> org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>>> at
>>>>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>>>>> ... 56 more -- Best regards / Med venlig hilsen Nino Martinez
>>>>
>>>>
>>>> --
>>>> Best regards / Med venlig hilsen
>>>> Nino Martinez
>>>>
>>>
>>> --
>>> Best regards / Med venlig hilsen
>>> Nino Martinez
>>>
>>
>> --
>> Best regards / Med venlig hilsen
>> Nino Martinez
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

nino martinez wael
I have replicated it here, I found the error a little counter intuitive:

https://github.com/nmwael/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.java

On Fri, Dec 7, 2018 at 5:48 PM Sven Meier <[hidden email]> wrote:

> Hi,
>
> the stacktrace shows clearly that you add a component to the ART while
> it is already rendering the response.
> This is not allowed, and this wasn't allowed in previous version.
>
> You'll have to provide a quickstart to prove that it worked previously.
>
> Regards
> Sven
>
> Am 06.12.18 um 13:50 schrieb nino martinez wael:
> > @[hidden email] <[hidden email]> what/how do I need to check
> > during the call? For now I have a breakpoint the place in the code where
> it
> > fails, but I need to figure out what closes the request target..
> >
> > On Mon, Dec 3, 2018 at 10:55 AM nino martinez wael <
> > [hidden email]> wrote:
> >
> >> I've debugged a lot further. But still unable to pinpoint it.. For now
> >> I've switched to rendering the full page instead, which of course works.
> >>
> >> We are a couple of things in conjunction with TREE, like wicket jquery
> ui
> >> draggable and droppable.. We also have a custom loading mechanism that
> pops
> >> a veil if the request are too long to load.. And some custom form
> handling
> >> aswell (auto show an marker for error'd form fields)..
> >>
> >> PS writing this for other to see, if they hit  this challenge..
> >>
> >> -Regards Nino
> >>
> >>
> >> On Thu, Nov 29, 2018 at 8:50 AM nino martinez wael <
> >> [hidden email]> wrote:
> >>
> >>> currently unable to reproduce in examples, something must be wrong in
> my
> >>> code..
> >>>
> >>> I'll comeback if it turns out otherwise..
> >>>
> >>> Thanks for helping :)
> >>>
> >>> On Thu, Nov 29, 2018 at 6:54 AM nino martinez wael <
> >>> [hidden email]> wrote:
> >>>
> >>>> Yes I understand.. Let me see if it breaks in wicket examples, or I
> can
> >>>> make it so.. Do you know another way to make a node/folder expand
> during
> >>>> construction time? Feels like the expand method are meant for ajax
> calls
> >>>> only.
> >>>>
> >>>> -regards Nino
> >>>>
> >>>> On Wed, Nov 28, 2018 at 4:16 PM sven <[hidden email]> wrote:
> >>>>
> >>>>>
> >>>>> Hi Nino,
> >>>>>
> >>>>>
> >>>>>
> >>>>> during rendering of components no additional components can be added
> to
> >>>>> the ART any more.
> >>>>>
> >>>>> I surprised that your code worked in 6.x, can you build a quickstart
> >>>>> demonstrating the problem?
> >>>>>
> >>>>>
> >>>>>
> >>>>> Have fun
> >>>>>
> >>>>> Sven
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>> On 28.11.2018 at 14:38,  <nino martinez wael>  wrote:
> >>>>>>
> >>>>>>
> >>>>>>   Hi In wicket 6 this worked, there are another input field (ajax
> >>>>> activated) that triggers the update : ChildAwareNestedTree
> >>>>> profilePartitionTree = new ChildAwareNestedTree("skillsetSelect",
> provider,
> >>>>> sharedExpansionState) { @Override protected Component
> >>>>> newContentComponent(String id, IModel model) { TreeNode node =
> >>>>> model.getObject(); if (node instanceof
> TreeNodeProvider.PartitionNode) {
> >>>>> Partition partition = ((TreeNodeProvider.PartitionNode)
> >>>>> node).getPartition(); if
> >>>>> (getPartitionsWithProfiles().containsKey(partition.getId())) {*
> >>>>> expand(node);* } } else if (node instanceof
> >>>>> TreeNodeProvider.NoPartitionNode  &&
> isNoPartitionProfilesPresent()) {*
> >>>>> expand(node);* } ....} The triggering field: searchTerm.add(new
> >>>>> AjaxFormComponentUpdatingBehavior("keydown") { @Override protected
> void
> >>>>> onUpdate(AjaxRequestTarget target) { if (searchTermModel.getObject()
> !=
> >>>>> null  &&  !searchTermModel.getObject().isEmpty()) {
> >>>>> profilePartitionTree.rebuildExpandedPartitions(); } else {
> >>>>> profilePartitionTree.getP
> >>>>> artitionsWithProfiles().clear(); }*
> target.add(profilePartitionTree);*
> >>>>> } @Override protected void updateAjaxAttributes(AjaxRequestAttributes
> >>>>> attributes) { super.updateAjaxAttributes(attributes);
> >>>>> attributes.setThrottlingSettings(new
> >>>>> ThrottlingSettings(searchTerm.getMarkupId(),
> Duration.milliseconds(400),
> >>>>> true)); } }); But I get an this error message in wicket 8, my line
> below:
> >>>>> 2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 |
> DefaultExceptionMapper
> >>>>> | 136 - org.apache.wicket.core - 8.1.0 | Unexpected error occurred
> >>>>> org.apache.wicket.WicketRuntimeException: Error attaching this
> container
> >>>>> for rendering: [Subtree [Component id = subtree]] at
> >>>>>
> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> >>>>> at org.apache.wicket.MarkupContai
> >>>>>
> ner.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01]
> >>>>> at
> >>>>>
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apa
> >>>>> che.wicket.core:8.1.0] at
> >>>>>
> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6()[jar:bundle://128.0:0/!/:]
> >>>>> at
> >>>>>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
> >>>>> at
> >>>>>
> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servic
> >>>>> emix.bundles.cglib:2.2.2.1] at
> >>>>>
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>> at
> >>>>>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle()[jar:bundle://128.0:0/!/:]
> >>>>> at
> >>>>>
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3()[jar:bundle://128.0:0/!/:]
> >>>>> at
> >>>>>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
> >>>>> at
> >>>>>
> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]
> >>>>> at
> >>>>>
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.int
> >>>>>
> ercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>> at
> >>>>>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter()[jar:bundle://128.0:0/!/:]
> >>>>> at
> >>>>>
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>> at
> >>>>>
> org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>> at
> >>>>>
> org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>> at
> >>>>>
> org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>> at
> >>>>>
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>> at o
> >>>>>
> rg.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> >>>>> at
> >>>>>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>> at org.eclipse.jetty.server.handler.Con
> >>>>>
> textHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> >>>>> at
> >>>>>
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> >>>>> at
> >>>>>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.e
> >>>>> clipse.jetty.server:9.2.21.v20170120] at
> >>>>>
> org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>   at
> >>>>>
> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>> at org.eclipse.jetty.io
> >>>>> .AbstractConnection$2.run(AbstractConnection.java:544)[73:
> >>>>> org.eclipse.jetty.io:9 .2.21.v20170120] at
> >>>>>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120]
> >>>>> at
> >>>>>
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120]
> >>>>> at java.lang.Thread.run(Unknown Source)[:1.8.0_111] Caused by:
> >>>>> java.lang.IllegalStateException: Components can no longer be added at
> >>>>>
> org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wick
> >>>>> et.core:8.1.0] at
> >>>>>
> org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122)
> >>>>> at
> >>>>>
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115)
> >>>>> at
> >>>>>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
> >>>>> a
> >>>>> t
> >>>>>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114)
> >>>>> at
> >>>>>
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0]
> >>>>> at java.util.Optional.ifPresent(Unknown Source)[:1.8.0_111]   at
> >>>>>
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0]
> >>>>> * at
> >>>>>
> dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]*
> >>>>> at
> >>>>>
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0]
> >>>>> at org.apache.wicket.extensions.markup.html.repe
> >>>>>
> ater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0]
> >>>>> at org.apache.wicket.MarkupContainer.addedComponent(Mark
> >>>>> upContainer.java:1014)[136:org.apache.wicket.core:8.1.0] at
> >>>>>
> org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> >>>>> at
> >>>>>
> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
> >>>>> ... 56 more -- Best regards / Med venlig hilsen Nino Martinez
> >>>>
> >>>>
> >>>> --
> >>>> Best regards / Med venlig hilsen
> >>>> Nino Martinez
> >>>>
> >>>
> >>> --
> >>> Best regards / Med venlig hilsen
> >>> Nino Martinez
> >>>
> >>
> >> --
> >> Best regards / Med venlig hilsen
> >> Nino Martinez
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Best regards / Med venlig hilsen
Nino Martinez
Reply | Threaded
Open this post in threaded view
|

Re: Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

Sven Meier
Hi,

found it:

- since WICKET-6335 the node content is created in #onInitialize() only
- at this moment the node is already inside the component hierarchy
- #updateBranch() finds the branch of the currently rendered node and
tries to add it to the ART
-> "Components can no  longer be added"

Compare this with 7.x:

- the node content is created directly from the constructor
- at this moment the node (and its parental branch) is not in the
component hierarchy yet
- #updateBranch() does not find any branch for the node's model and
doesn't add anything to the ART

So yes, we have a change, but no bug. In 7.x adding of the branch to the
ART was just ignored.

You can achieve the same in Wicket 8.x with the following:

             protected Component newContentComponent(String id,
IModel<Foo> node) {
                 if(haveClicked){
                     // #expand() can not be used, since it tries to add
the branch
                     // to the ART, which is not allowed during rendering
                     getModelObject().add(node.getObject());
                 }
                 return super.newContentComponent(id, node);
             }

Have fun
Sven

Am 10.12.18 um 08:41 schrieb nino martinez wael:

> I have replicated it here, I found the error a little counter intuitive:
>
> https://github.com/nmwael/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.java
>
> On Fri, Dec 7, 2018 at 5:48 PM Sven Meier <[hidden email]> wrote:
>
>> Hi,
>>
>> the stacktrace shows clearly that you add a component to the ART while
>> it is already rendering the response.
>> This is not allowed, and this wasn't allowed in previous version.
>>
>> You'll have to provide a quickstart to prove that it worked previously.
>>
>> Regards
>> Sven
>>
>> Am 06.12.18 um 13:50 schrieb nino martinez wael:
>>> @[hidden email] <[hidden email]> what/how do I need to check
>>> during the call? For now I have a breakpoint the place in the code where
>> it
>>> fails, but I need to figure out what closes the request target..
>>>
>>> On Mon, Dec 3, 2018 at 10:55 AM nino martinez wael <
>>> [hidden email]> wrote:
>>>
>>>> I've debugged a lot further. But still unable to pinpoint it.. For now
>>>> I've switched to rendering the full page instead, which of course works.
>>>>
>>>> We are a couple of things in conjunction with TREE, like wicket jquery
>> ui
>>>> draggable and droppable.. We also have a custom loading mechanism that
>> pops
>>>> a veil if the request are too long to load.. And some custom form
>> handling
>>>> aswell (auto show an marker for error'd form fields)..
>>>>
>>>> PS writing this for other to see, if they hit  this challenge..
>>>>
>>>> -Regards Nino
>>>>
>>>>
>>>> On Thu, Nov 29, 2018 at 8:50 AM nino martinez wael <
>>>> [hidden email]> wrote:
>>>>
>>>>> currently unable to reproduce in examples, something must be wrong in
>> my
>>>>> code..
>>>>>
>>>>> I'll comeback if it turns out otherwise..
>>>>>
>>>>> Thanks for helping :)
>>>>>
>>>>> On Thu, Nov 29, 2018 at 6:54 AM nino martinez wael <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>> Yes I understand.. Let me see if it breaks in wicket examples, or I
>> can
>>>>>> make it so.. Do you know another way to make a node/folder expand
>> during
>>>>>> construction time? Feels like the expand method are meant for ajax
>> calls
>>>>>> only.
>>>>>>
>>>>>> -regards Nino
>>>>>>
>>>>>> On Wed, Nov 28, 2018 at 4:16 PM sven <[hidden email]> wrote:
>>>>>>
>>>>>>> Hi Nino,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> during rendering of components no additional components can be added
>> to
>>>>>>> the ART any more.
>>>>>>>
>>>>>>> I surprised that your code worked in 6.x, can you build a quickstart
>>>>>>> demonstrating the problem?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Have fun
>>>>>>>
>>>>>>> Sven
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> On 28.11.2018 at 14:38,  <nino martinez wael>  wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>    Hi In wicket 6 this worked, there are another input field (ajax
>>>>>>> activated) that triggers the update : ChildAwareNestedTree
>>>>>>> profilePartitionTree = new ChildAwareNestedTree("skillsetSelect",
>> provider,
>>>>>>> sharedExpansionState) { @Override protected Component
>>>>>>> newContentComponent(String id, IModel model) { TreeNode node =
>>>>>>> model.getObject(); if (node instanceof
>> TreeNodeProvider.PartitionNode) {
>>>>>>> Partition partition = ((TreeNodeProvider.PartitionNode)
>>>>>>> node).getPartition(); if
>>>>>>> (getPartitionsWithProfiles().containsKey(partition.getId())) {*
>>>>>>> expand(node);* } } else if (node instanceof
>>>>>>> TreeNodeProvider.NoPartitionNode  &&
>> isNoPartitionProfilesPresent()) {*
>>>>>>> expand(node);* } ....} The triggering field: searchTerm.add(new
>>>>>>> AjaxFormComponentUpdatingBehavior("keydown") { @Override protected
>> void
>>>>>>> onUpdate(AjaxRequestTarget target) { if (searchTermModel.getObject()
>> !=
>>>>>>> null  &&  !searchTermModel.getObject().isEmpty()) {
>>>>>>> profilePartitionTree.rebuildExpandedPartitions(); } else {
>>>>>>> profilePartitionTree.getP
>>>>>>> artitionsWithProfiles().clear(); }*
>> target.add(profilePartitionTree);*
>>>>>>> } @Override protected void updateAjaxAttributes(AjaxRequestAttributes
>>>>>>> attributes) { super.updateAjaxAttributes(attributes);
>>>>>>> attributes.setThrottlingSettings(new
>>>>>>> ThrottlingSettings(searchTerm.getMarkupId(),
>> Duration.milliseconds(400),
>>>>>>> true)); } }); But I get an this error message in wicket 8, my line
>> below:
>>>>>>> 2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 |
>> DefaultExceptionMapper
>>>>>>> | 136 - org.apache.wicket.core - 8.1.0 | Unexpected error occurred
>>>>>>> org.apache.wicket.WicketRuntimeException: Error attaching this
>> container
>>>>>>> for rendering: [Subtree [Component id = subtree]] at
>>>>>>>
>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at org.apache.wicket.MarkupContai
>>>>>>>
>> ner.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apa
>>>>>>> che.wicket.core:8.1.0] at
>>>>>>>
>> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6()[jar:bundle://128.0:0/!/:]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>>>>>>> at
>>>>>>>
>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servic
>>>>>>> emix.bundles.cglib:2.2.2.1] at
>>>>>>>
>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle()[jar:bundle://128.0:0/!/:]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3()[jar:bundle://128.0:0/!/:]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>>>>>>> at
>>>>>>>
>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]
>>>>>>> at
>>>>>>>
>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.int
>> ercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter()[jar:bundle://128.0:0/!/:]
>>>>>>> at
>>>>>>>
>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>> at
>>>>>>>
>> org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>> at
>>>>>>>
>> org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>> at
>>>>>>>
>> org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>>>> at o
>>>>>>>
>> rg.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>> at org.eclipse.jetty.server.handler.Con
>>>>>>>
>> textHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.e
>>>>>>> clipse.jetty.server:9.2.21.v20170120] at
>>>>>>>
>> org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>>    at
>>>>>>>
>> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>> at org.eclipse.jetty.io
>>>>>>> .AbstractConnection$2.run(AbstractConnection.java:544)[73:
>>>>>>> org.eclipse.jetty.io:9 .2.21.v20170120] at
>>>>>>>
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>>>>>>> at
>>>>>>>
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>>>>>>> at java.lang.Thread.run(Unknown Source)[:1.8.0_111] Caused by:
>>>>>>> java.lang.IllegalStateException: Components can no longer be added at
>>>>>>>
>> org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wick
>>>>>>> et.core:8.1.0] at
>>>>>>>
>> org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122)
>>>>>>> at
>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115)
>>>>>>> at
>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>>>>>>> a
>>>>>>> t
>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114)
>>>>>>> at
>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0]
>>>>>>> at java.util.Optional.ifPresent(Unknown Source)[:1.8.0_111]   at
>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0]
>>>>>>> * at
>>>>>>>
>> dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]*
>>>>>>> at
>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0]
>>>>>>> at org.apache.wicket.extensions.markup.html.repe
>>>>>>>
>> ater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at org.apache.wicket.MarkupContainer.addedComponent(Mark
>>>>>>> upContainer.java:1014)[136:org.apache.wicket.core:8.1.0] at
>>>>>>>
>> org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>>>>> at
>>>>>>>
>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>>>>>>> ... 56 more -- Best regards / Med venlig hilsen Nino Martinez
>>>>>>
>>>>>> --
>>>>>> Best regards / Med venlig hilsen
>>>>>> Nino Martinez
>>>>>>
>>>>> --
>>>>> Best regards / Med venlig hilsen
>>>>> Nino Martinez
>>>>>
>>>> --
>>>> Best regards / Med venlig hilsen
>>>> Nino Martinez
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

nino martinez wael
I agree, i just find the error message strange.. Normally if i add an
component with target.add it does not break.. If it breaks and we know it
breaks maybe an warning or error message should come from the tree that it
cannot have expand in new component on ajax requests..



Ps typing iæon phone

On Mon, 10 Dec 2018, 11:04 Sven Meier, <[hidden email]> wrote:

> Hi,
>
> found it:
>
> - since WICKET-6335 the node content is created in #onInitialize() only
> - at this moment the node is already inside the component hierarchy
> - #updateBranch() finds the branch of the currently rendered node and
> tries to add it to the ART
> -> "Components can no  longer be added"
>
> Compare this with 7.x:
>
> - the node content is created directly from the constructor
> - at this moment the node (and its parental branch) is not in the
> component hierarchy yet
> - #updateBranch() does not find any branch for the node's model and
> doesn't add anything to the ART
>
> So yes, we have a change, but no bug. In 7.x adding of the branch to the
> ART was just ignored.
>
> You can achieve the same in Wicket 8.x with the following:
>
>              protected Component newContentComponent(String id,
> IModel<Foo> node) {
>                  if(haveClicked){
>                      // #expand() can not be used, since it tries to add
> the branch
>                      // to the ART, which is not allowed during rendering
>                      getModelObject().add(node.getObject());
>                  }
>                  return super.newContentComponent(id, node);
>              }
>
> Have fun
> Sven
>
> Am 10.12.18 um 08:41 schrieb nino martinez wael:
> > I have replicated it here, I found the error a little counter intuitive:
> >
> >
> https://github.com/nmwael/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.java
> >
> > On Fri, Dec 7, 2018 at 5:48 PM Sven Meier <[hidden email]> wrote:
> >
> >> Hi,
> >>
> >> the stacktrace shows clearly that you add a component to the ART while
> >> it is already rendering the response.
> >> This is not allowed, and this wasn't allowed in previous version.
> >>
> >> You'll have to provide a quickstart to prove that it worked previously.
> >>
> >> Regards
> >> Sven
> >>
> >> Am 06.12.18 um 13:50 schrieb nino martinez wael:
> >>> @[hidden email] <[hidden email]> what/how do I need to
> check
> >>> during the call? For now I have a breakpoint the place in the code
> where
> >> it
> >>> fails, but I need to figure out what closes the request target..
> >>>
> >>> On Mon, Dec 3, 2018 at 10:55 AM nino martinez wael <
> >>> [hidden email]> wrote:
> >>>
> >>>> I've debugged a lot further. But still unable to pinpoint it.. For now
> >>>> I've switched to rendering the full page instead, which of course
> works.
> >>>>
> >>>> We are a couple of things in conjunction with TREE, like wicket jquery
> >> ui
> >>>> draggable and droppable.. We also have a custom loading mechanism that
> >> pops
> >>>> a veil if the request are too long to load.. And some custom form
> >> handling
> >>>> aswell (auto show an marker for error'd form fields)..
> >>>>
> >>>> PS writing this for other to see, if they hit  this challenge..
> >>>>
> >>>> -Regards Nino
> >>>>
> >>>>
> >>>> On Thu, Nov 29, 2018 at 8:50 AM nino martinez wael <
> >>>> [hidden email]> wrote:
> >>>>
> >>>>> currently unable to reproduce in examples, something must be wrong in
> >> my
> >>>>> code..
> >>>>>
> >>>>> I'll comeback if it turns out otherwise..
> >>>>>
> >>>>> Thanks for helping :)
> >>>>>
> >>>>> On Thu, Nov 29, 2018 at 6:54 AM nino martinez wael <
> >>>>> [hidden email]> wrote:
> >>>>>
> >>>>>> Yes I understand.. Let me see if it breaks in wicket examples, or I
> >> can
> >>>>>> make it so.. Do you know another way to make a node/folder expand
> >> during
> >>>>>> construction time? Feels like the expand method are meant for ajax
> >> calls
> >>>>>> only.
> >>>>>>
> >>>>>> -regards Nino
> >>>>>>
> >>>>>> On Wed, Nov 28, 2018 at 4:16 PM sven <[hidden email]> wrote:
> >>>>>>
> >>>>>>> Hi Nino,
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> during rendering of components no additional components can be
> added
> >> to
> >>>>>>> the ART any more.
> >>>>>>>
> >>>>>>> I surprised that your code worked in 6.x, can you build a
> quickstart
> >>>>>>> demonstrating the problem?
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> Have fun
> >>>>>>>
> >>>>>>> Sven
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>> On 28.11.2018 at 14:38,  <nino martinez wael>  wrote:
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>    Hi In wicket 6 this worked, there are another input field (ajax
> >>>>>>> activated) that triggers the update : ChildAwareNestedTree
> >>>>>>> profilePartitionTree = new ChildAwareNestedTree("skillsetSelect",
> >> provider,
> >>>>>>> sharedExpansionState) { @Override protected Component
> >>>>>>> newContentComponent(String id, IModel model) { TreeNode node =
> >>>>>>> model.getObject(); if (node instanceof
> >> TreeNodeProvider.PartitionNode) {
> >>>>>>> Partition partition = ((TreeNodeProvider.PartitionNode)
> >>>>>>> node).getPartition(); if
> >>>>>>> (getPartitionsWithProfiles().containsKey(partition.getId())) {*
> >>>>>>> expand(node);* } } else if (node instanceof
> >>>>>>> TreeNodeProvider.NoPartitionNode  &&
> >> isNoPartitionProfilesPresent()) {*
> >>>>>>> expand(node);* } ....} The triggering field: searchTerm.add(new
> >>>>>>> AjaxFormComponentUpdatingBehavior("keydown") { @Override protected
> >> void
> >>>>>>> onUpdate(AjaxRequestTarget target) { if
> (searchTermModel.getObject()
> >> !=
> >>>>>>> null  &&  !searchTermModel.getObject().isEmpty()) {
> >>>>>>> profilePartitionTree.rebuildExpandedPartitions(); } else {
> >>>>>>> profilePartitionTree.getP
> >>>>>>> artitionsWithProfiles().clear(); }*
> >> target.add(profilePartitionTree);*
> >>>>>>> } @Override protected void
> updateAjaxAttributes(AjaxRequestAttributes
> >>>>>>> attributes) { super.updateAjaxAttributes(attributes);
> >>>>>>> attributes.setThrottlingSettings(new
> >>>>>>> ThrottlingSettings(searchTerm.getMarkupId(),
> >> Duration.milliseconds(400),
> >>>>>>> true)); } }); But I get an this error message in wicket 8, my line
> >> below:
> >>>>>>> 2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 |
> >> DefaultExceptionMapper
> >>>>>>> | 136 - org.apache.wicket.core - 8.1.0 | Unexpected error occurred
> >>>>>>> org.apache.wicket.WicketRuntimeException: Error attaching this
> >> container
> >>>>>>> for rendering: [Subtree [Component id = subtree]] at
> >>>>>>>
> >>
> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at org.apache.wicket.MarkupContai
> >>>>>>>
> >>
> ner.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apa
> >>>>>>> che.wicket.core:8.1.0] at
> >>>>>>>
> >>
> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6()[jar:bundle://128.0:0/!/:]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
> >>>>>>> at
> >>>>>>>
> >>
> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servic
> >>>>>>> emix.bundles.cglib:2.2.2.1] at
> >>>>>>>
> >>
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle()[jar:bundle://128.0:0/!/:]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3()[jar:bundle://128.0:0/!/:]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
> >>>>>>> at
> >>>>>>>
> >>
> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]
> >>>>>>> at
> >>>>>>>
> >>
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.int
> >>
> ercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter()[jar:bundle://128.0:0/!/:]
> >>>>>>> at
> >>>>>>>
> >>
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>>>> at o
> >>>>>>>
> >>
> rg.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>> at org.eclipse.jetty.server.handler.Con
> >>>>>>>
> >>
> textHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.e
> >>>>>>> clipse.jetty.server:9.2.21.v20170120] at
> >>>>>>>
> >>
> org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>>    at
> >>>>>>>
> >>
> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>> at org.eclipse.jetty.io
> >>>>>>> .AbstractConnection$2.run(AbstractConnection.java:544)[73:
> >>>>>>> org.eclipse.jetty.io:9 .2.21.v20170120] at
> >>>>>>>
> >>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120]
> >>>>>>> at
> >>>>>>>
> >>
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120]
> >>>>>>> at java.lang.Thread.run(Unknown Source)[:1.8.0_111] Caused by:
> >>>>>>> java.lang.IllegalStateException: Components can no longer be added
> at
> >>>>>>>
> >>
> org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wick
> >>>>>>> et.core:8.1.0] at
> >>>>>>>
> >>
> org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122)
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115)
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
> >>>>>>> a
> >>>>>>> t
> >>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114)
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0]
> >>>>>>> at java.util.Optional.ifPresent(Unknown Source)[:1.8.0_111]   at
> >>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0]
> >>>>>>> * at
> >>>>>>>
> >>
> dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]*
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0]
> >>>>>>> at org.apache.wicket.extensions.markup.html.repe
> >>>>>>>
> >>
> ater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at org.apache.wicket.MarkupContainer.addedComponent(Mark
> >>>>>>> upContainer.java:1014)[136:org.apache.wicket.core:8.1.0] at
> >>>>>>>
> >>
> org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> at
> >>>>>>>
> >>
> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
> >>>>>>> ... 56 more -- Best regards / Med venlig hilsen Nino Martinez
> >>>>>>
> >>>>>> --
> >>>>>> Best regards / Med venlig hilsen
> >>>>>> Nino Martinez
> >>>>>>
> >>>>> --
> >>>>> Best regards / Med venlig hilsen
> >>>>> Nino Martinez
> >>>>>
> >>>> --
> >>>> Best regards / Med venlig hilsen
> >>>> Nino Martinez
> >>>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

Sven Meier
Hi Nino,

I've expanded the error message for now.

We could make that method on NestedTree lenient, i.e. catch the
exception and log the message instead.
But you could do that for yourself in your code too.

Have fun
Sven

Am 10.12.18 um 11:16 schrieb nino martinez wael:

> I agree, i just find the error message strange.. Normally if i add an
> component with target.add it does not break.. If it breaks and we know it
> breaks maybe an warning or error message should come from the tree that it
> cannot have expand in new component on ajax requests..
>
>
>
> Ps typing iæon phone
>
> On Mon, 10 Dec 2018, 11:04 Sven Meier, <[hidden email]> wrote:
>
>> Hi,
>>
>> found it:
>>
>> - since WICKET-6335 the node content is created in #onInitialize() only
>> - at this moment the node is already inside the component hierarchy
>> - #updateBranch() finds the branch of the currently rendered node and
>> tries to add it to the ART
>> -> "Components can no  longer be added"
>>
>> Compare this with 7.x:
>>
>> - the node content is created directly from the constructor
>> - at this moment the node (and its parental branch) is not in the
>> component hierarchy yet
>> - #updateBranch() does not find any branch for the node's model and
>> doesn't add anything to the ART
>>
>> So yes, we have a change, but no bug. In 7.x adding of the branch to the
>> ART was just ignored.
>>
>> You can achieve the same in Wicket 8.x with the following:
>>
>>               protected Component newContentComponent(String id,
>> IModel<Foo> node) {
>>                   if(haveClicked){
>>                       // #expand() can not be used, since it tries to add
>> the branch
>>                       // to the ART, which is not allowed during rendering
>>                       getModelObject().add(node.getObject());
>>                   }
>>                   return super.newContentComponent(id, node);
>>               }
>>
>> Have fun
>> Sven
>>
>> Am 10.12.18 um 08:41 schrieb nino martinez wael:
>>> I have replicated it here, I found the error a little counter intuitive:
>>>
>>>
>> https://github.com/nmwael/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.java
>>> On Fri, Dec 7, 2018 at 5:48 PM Sven Meier <[hidden email]> wrote:
>>>
>>>> Hi,
>>>>
>>>> the stacktrace shows clearly that you add a component to the ART while
>>>> it is already rendering the response.
>>>> This is not allowed, and this wasn't allowed in previous version.
>>>>
>>>> You'll have to provide a quickstart to prove that it worked previously.
>>>>
>>>> Regards
>>>> Sven
>>>>
>>>> Am 06.12.18 um 13:50 schrieb nino martinez wael:
>>>>> @[hidden email] <[hidden email]> what/how do I need to
>> check
>>>>> during the call? For now I have a breakpoint the place in the code
>> where
>>>> it
>>>>> fails, but I need to figure out what closes the request target..
>>>>>
>>>>> On Mon, Dec 3, 2018 at 10:55 AM nino martinez wael <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>> I've debugged a lot further. But still unable to pinpoint it.. For now
>>>>>> I've switched to rendering the full page instead, which of course
>> works.
>>>>>> We are a couple of things in conjunction with TREE, like wicket jquery
>>>> ui
>>>>>> draggable and droppable.. We also have a custom loading mechanism that
>>>> pops
>>>>>> a veil if the request are too long to load.. And some custom form
>>>> handling
>>>>>> aswell (auto show an marker for error'd form fields)..
>>>>>>
>>>>>> PS writing this for other to see, if they hit  this challenge..
>>>>>>
>>>>>> -Regards Nino
>>>>>>
>>>>>>
>>>>>> On Thu, Nov 29, 2018 at 8:50 AM nino martinez wael <
>>>>>> [hidden email]> wrote:
>>>>>>
>>>>>>> currently unable to reproduce in examples, something must be wrong in
>>>> my
>>>>>>> code..
>>>>>>>
>>>>>>> I'll comeback if it turns out otherwise..
>>>>>>>
>>>>>>> Thanks for helping :)
>>>>>>>
>>>>>>> On Thu, Nov 29, 2018 at 6:54 AM nino martinez wael <
>>>>>>> [hidden email]> wrote:
>>>>>>>
>>>>>>>> Yes I understand.. Let me see if it breaks in wicket examples, or I
>>>> can
>>>>>>>> make it so.. Do you know another way to make a node/folder expand
>>>> during
>>>>>>>> construction time? Feels like the expand method are meant for ajax
>>>> calls
>>>>>>>> only.
>>>>>>>>
>>>>>>>> -regards Nino
>>>>>>>>
>>>>>>>> On Wed, Nov 28, 2018 at 4:16 PM sven <[hidden email]> wrote:
>>>>>>>>
>>>>>>>>> Hi Nino,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> during rendering of components no additional components can be
>> added
>>>> to
>>>>>>>>> the ART any more.
>>>>>>>>>
>>>>>>>>> I surprised that your code worked in 6.x, can you build a
>> quickstart
>>>>>>>>> demonstrating the problem?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Have fun
>>>>>>>>>
>>>>>>>>> Sven
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> On 28.11.2018 at 14:38,  <nino martinez wael>  wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     Hi In wicket 6 this worked, there are another input field (ajax
>>>>>>>>> activated) that triggers the update : ChildAwareNestedTree
>>>>>>>>> profilePartitionTree = new ChildAwareNestedTree("skillsetSelect",
>>>> provider,
>>>>>>>>> sharedExpansionState) { @Override protected Component
>>>>>>>>> newContentComponent(String id, IModel model) { TreeNode node =
>>>>>>>>> model.getObject(); if (node instanceof
>>>> TreeNodeProvider.PartitionNode) {
>>>>>>>>> Partition partition = ((TreeNodeProvider.PartitionNode)
>>>>>>>>> node).getPartition(); if
>>>>>>>>> (getPartitionsWithProfiles().containsKey(partition.getId())) {*
>>>>>>>>> expand(node);* } } else if (node instanceof
>>>>>>>>> TreeNodeProvider.NoPartitionNode  &&
>>>> isNoPartitionProfilesPresent()) {*
>>>>>>>>> expand(node);* } ....} The triggering field: searchTerm.add(new
>>>>>>>>> AjaxFormComponentUpdatingBehavior("keydown") { @Override protected
>>>> void
>>>>>>>>> onUpdate(AjaxRequestTarget target) { if
>> (searchTermModel.getObject()
>>>> !=
>>>>>>>>> null  &&  !searchTermModel.getObject().isEmpty()) {
>>>>>>>>> profilePartitionTree.rebuildExpandedPartitions(); } else {
>>>>>>>>> profilePartitionTree.getP
>>>>>>>>> artitionsWithProfiles().clear(); }*
>>>> target.add(profilePartitionTree);*
>>>>>>>>> } @Override protected void
>> updateAjaxAttributes(AjaxRequestAttributes
>>>>>>>>> attributes) { super.updateAjaxAttributes(attributes);
>>>>>>>>> attributes.setThrottlingSettings(new
>>>>>>>>> ThrottlingSettings(searchTerm.getMarkupId(),
>>>> Duration.milliseconds(400),
>>>>>>>>> true)); } }); But I get an this error message in wicket 8, my line
>>>> below:
>>>>>>>>> 2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 |
>>>> DefaultExceptionMapper
>>>>>>>>> | 136 - org.apache.wicket.core - 8.1.0 | Unexpected error occurred
>>>>>>>>> org.apache.wicket.WicketRuntimeException: Error attaching this
>>>> container
>>>>>>>>> for rendering: [Subtree [Component id = subtree]] at
>>>>>>>>>
>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at org.apache.wicket.MarkupContai
>>>>>>>>>
>> ner.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apa
>>>>>>>>> che.wicket.core:8.1.0] at
>>>>>>>>>
>> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6()[jar:bundle://128.0:0/!/:]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>>>>>>>>> at
>>>>>>>>>
>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servic
>>>>>>>>> emix.bundles.cglib:2.2.2.1] at
>>>>>>>>>
>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle()[jar:bundle://128.0:0/!/:]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3()[jar:bundle://128.0:0/!/:]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
>>>>>>>>> at
>>>>>>>>>
>> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]
>>>>>>>>> at
>>>>>>>>>
>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.int
>> ercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter()[jar:bundle://128.0:0/!/:]
>>>>>>>>> at
>>>>>>>>>
>> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>>>> at
>>>>>>>>>
>> org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>>>> at
>>>>>>>>>
>> org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>>>> at
>>>>>>>>>
>> org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>>>>>> at o
>>>>>>>>>
>> rg.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>>>> at org.eclipse.jetty.server.handler.Con
>>>>>>>>>
>> textHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.e
>>>>>>>>> clipse.jetty.server:9.2.21.v20170120] at
>>>>>>>>>
>> org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>>>>     at
>>>>>>>>>
>> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120]
>>>>>>>>> at org.eclipse.jetty.io
>>>>>>>>> .AbstractConnection$2.run(AbstractConnection.java:544)[73:
>>>>>>>>> org.eclipse.jetty.io:9 .2.21.v20170120] at
>>>>>>>>>
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>>>>>>>>> at
>>>>>>>>>
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120]
>>>>>>>>> at java.lang.Thread.run(Unknown Source)[:1.8.0_111] Caused by:
>>>>>>>>> java.lang.IllegalStateException: Components can no longer be added
>> at
>> org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wick
>>>>>>>>> et.core:8.1.0] at
>>>>>>>>>
>> org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122)
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115)
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
>>>>>>>>> a
>>>>>>>>> t
>>>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114)
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0]
>>>>>>>>> at java.util.Optional.ifPresent(Unknown Source)[:1.8.0_111]   at
>>>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0]
>>>>>>>>> * at
>>>>>>>>>
>> dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]*
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0]
>>>>>>>>> at org.apache.wicket.extensions.markup.html.repe
>>>>>>>>>
>> ater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at org.apache.wicket.MarkupContainer.addedComponent(Mark
>>>>>>>>> upContainer.java:1014)[136:org.apache.wicket.core:8.1.0] at
>>>>>>>>>
>> org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> at
>>>>>>>>>
>> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
>>>>>>>>> ... 56 more -- Best regards / Med venlig hilsen Nino Martinez
>>>>>>>> --
>>>>>>>> Best regards / Med venlig hilsen
>>>>>>>> Nino Martinez
>>>>>>>>
>>>>>>> --
>>>>>>> Best regards / Med venlig hilsen
>>>>>>> Nino Martinez
>>>>>>>
>>>>>> --
>>>>>> Best regards / Med venlig hilsen
>>>>>> Nino Martinez
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Wicket 6.x -> Wicket 8.x extensions NestedTree expand fails ( Components can no longer be added)

nino martinez wael
Sure, I was not so much thinking of me but other wicket users.. I've asked
around and at least here its not a "normal" wicket behavior that you could
break something by calling target.add(component).. And its not that I do
not want the error message, just to make it a little more clear to the
developer on whats wrong.. Not many would know that by calling target.add
you are breaking art because of internals of the tree..

A more pragmatic solution could also just to write in the java doc that
calling target.add + having expand in the  newContentComponent method are a
no go and will break runtime.

right now expand java doc are just "Expand the given node, tries to update
the affected branch if the change happens on an AjaxRequestTarget
<https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/ajax/AjaxRequestTarget.html>
."


regards Nino

On Tue, Dec 11, 2018 at 10:02 PM Sven Meier <[hidden email]> wrote:

> Hi Nino,
>
> I've expanded the error message for now.
>
> We could make that method on NestedTree lenient, i.e. catch the
> exception and log the message instead.
> But you could do that for yourself in your code too.
>
> Have fun
> Sven
>
> Am 10.12.18 um 11:16 schrieb nino martinez wael:
> > I agree, i just find the error message strange.. Normally if i add an
> > component with target.add it does not break.. If it breaks and we know it
> > breaks maybe an warning or error message should come from the tree that
> it
> > cannot have expand in new component on ajax requests..
> >
> >
> >
> > Ps typing iæon phone
> >
> > On Mon, 10 Dec 2018, 11:04 Sven Meier, <[hidden email]> wrote:
> >
> >> Hi,
> >>
> >> found it:
> >>
> >> - since WICKET-6335 the node content is created in #onInitialize() only
> >> - at this moment the node is already inside the component hierarchy
> >> - #updateBranch() finds the branch of the currently rendered node and
> >> tries to add it to the ART
> >> -> "Components can no  longer be added"
> >>
> >> Compare this with 7.x:
> >>
> >> - the node content is created directly from the constructor
> >> - at this moment the node (and its parental branch) is not in the
> >> component hierarchy yet
> >> - #updateBranch() does not find any branch for the node's model and
> >> doesn't add anything to the ART
> >>
> >> So yes, we have a change, but no bug. In 7.x adding of the branch to the
> >> ART was just ignored.
> >>
> >> You can achieve the same in Wicket 8.x with the following:
> >>
> >>               protected Component newContentComponent(String id,
> >> IModel<Foo> node) {
> >>                   if(haveClicked){
> >>                       // #expand() can not be used, since it tries to
> add
> >> the branch
> >>                       // to the ART, which is not allowed during
> rendering
> >>                       getModelObject().add(node.getObject());
> >>                   }
> >>                   return super.newContentComponent(id, node);
> >>               }
> >>
> >> Have fun
> >> Sven
> >>
> >> Am 10.12.18 um 08:41 schrieb nino martinez wael:
> >>> I have replicated it here, I found the error a little counter
> intuitive:
> >>>
> >>>
> >>
> https://github.com/nmwael/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/tree/BeginnersTreePage.java
> >>> On Fri, Dec 7, 2018 at 5:48 PM Sven Meier <[hidden email]> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> the stacktrace shows clearly that you add a component to the ART while
> >>>> it is already rendering the response.
> >>>> This is not allowed, and this wasn't allowed in previous version.
> >>>>
> >>>> You'll have to provide a quickstart to prove that it worked
> previously.
> >>>>
> >>>> Regards
> >>>> Sven
> >>>>
> >>>> Am 06.12.18 um 13:50 schrieb nino martinez wael:
> >>>>> @[hidden email] <[hidden email]> what/how do I need to
> >> check
> >>>>> during the call? For now I have a breakpoint the place in the code
> >> where
> >>>> it
> >>>>> fails, but I need to figure out what closes the request target..
> >>>>>
> >>>>> On Mon, Dec 3, 2018 at 10:55 AM nino martinez wael <
> >>>>> [hidden email]> wrote:
> >>>>>
> >>>>>> I've debugged a lot further. But still unable to pinpoint it.. For
> now
> >>>>>> I've switched to rendering the full page instead, which of course
> >> works.
> >>>>>> We are a couple of things in conjunction with TREE, like wicket
> jquery
> >>>> ui
> >>>>>> draggable and droppable.. We also have a custom loading mechanism
> that
> >>>> pops
> >>>>>> a veil if the request are too long to load.. And some custom form
> >>>> handling
> >>>>>> aswell (auto show an marker for error'd form fields)..
> >>>>>>
> >>>>>> PS writing this for other to see, if they hit  this challenge..
> >>>>>>
> >>>>>> -Regards Nino
> >>>>>>
> >>>>>>
> >>>>>> On Thu, Nov 29, 2018 at 8:50 AM nino martinez wael <
> >>>>>> [hidden email]> wrote:
> >>>>>>
> >>>>>>> currently unable to reproduce in examples, something must be wrong
> in
> >>>> my
> >>>>>>> code..
> >>>>>>>
> >>>>>>> I'll comeback if it turns out otherwise..
> >>>>>>>
> >>>>>>> Thanks for helping :)
> >>>>>>>
> >>>>>>> On Thu, Nov 29, 2018 at 6:54 AM nino martinez wael <
> >>>>>>> [hidden email]> wrote:
> >>>>>>>
> >>>>>>>> Yes I understand.. Let me see if it breaks in wicket examples, or
> I
> >>>> can
> >>>>>>>> make it so.. Do you know another way to make a node/folder expand
> >>>> during
> >>>>>>>> construction time? Feels like the expand method are meant for ajax
> >>>> calls
> >>>>>>>> only.
> >>>>>>>>
> >>>>>>>> -regards Nino
> >>>>>>>>
> >>>>>>>> On Wed, Nov 28, 2018 at 4:16 PM sven <[hidden email]> wrote:
> >>>>>>>>
> >>>>>>>>> Hi Nino,
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> during rendering of components no additional components can be
> >> added
> >>>> to
> >>>>>>>>> the ART any more.
> >>>>>>>>>
> >>>>>>>>> I surprised that your code worked in 6.x, can you build a
> >> quickstart
> >>>>>>>>> demonstrating the problem?
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Have fun
> >>>>>>>>>
> >>>>>>>>> Sven
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>> On 28.11.2018 at 14:38,  <nino martinez wael>  wrote:
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>     Hi In wicket 6 this worked, there are another input field
> (ajax
> >>>>>>>>> activated) that triggers the update : ChildAwareNestedTree
> >>>>>>>>> profilePartitionTree = new ChildAwareNestedTree("skillsetSelect",
> >>>> provider,
> >>>>>>>>> sharedExpansionState) { @Override protected Component
> >>>>>>>>> newContentComponent(String id, IModel model) { TreeNode node =
> >>>>>>>>> model.getObject(); if (node instanceof
> >>>> TreeNodeProvider.PartitionNode) {
> >>>>>>>>> Partition partition = ((TreeNodeProvider.PartitionNode)
> >>>>>>>>> node).getPartition(); if
> >>>>>>>>> (getPartitionsWithProfiles().containsKey(partition.getId())) {*
> >>>>>>>>> expand(node);* } } else if (node instanceof
> >>>>>>>>> TreeNodeProvider.NoPartitionNode  &&
> >>>> isNoPartitionProfilesPresent()) {*
> >>>>>>>>> expand(node);* } ....} The triggering field: searchTerm.add(new
> >>>>>>>>> AjaxFormComponentUpdatingBehavior("keydown") { @Override
> protected
> >>>> void
> >>>>>>>>> onUpdate(AjaxRequestTarget target) { if
> >> (searchTermModel.getObject()
> >>>> !=
> >>>>>>>>> null  &&  !searchTermModel.getObject().isEmpty()) {
> >>>>>>>>> profilePartitionTree.rebuildExpandedPartitions(); } else {
> >>>>>>>>> profilePartitionTree.getP
> >>>>>>>>> artitionsWithProfiles().clear(); }*
> >>>> target.add(profilePartitionTree);*
> >>>>>>>>> } @Override protected void
> >> updateAjaxAttributes(AjaxRequestAttributes
> >>>>>>>>> attributes) { super.updateAjaxAttributes(attributes);
> >>>>>>>>> attributes.setThrottlingSettings(new
> >>>>>>>>> ThrottlingSettings(searchTerm.getMarkupId(),
> >>>> Duration.milliseconds(400),
> >>>>>>>>> true)); } }); But I get an this error message in wicket 8, my
> line
> >>>> below:
> >>>>>>>>> 2018-11-28 14:26:44,127 | ERROR | qtp938432184-652 |
> >>>> DefaultExceptionMapper
> >>>>>>>>> | 136 - org.apache.wicket.core - 8.1.0 | Unexpected error
> occurred
> >>>>>>>>> org.apache.wicket.WicketRuntimeException: Error attaching this
> >>>> container
> >>>>>>>>> for rendering: [Subtree [Component id = subtree]] at
> >>>>>>>>>
> >>
> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1765)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at org.apache.wicket.MarkupContai
> >>>>>>>>>
> >>
> ner.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.Component.onBeforeRender(Component.java:3788)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> dk.netdesign.XXX.frontend.tree.ChildAwareNestedTree.onBeforeRender(ChildAwareNestedTree.java:41)[106:XXX-frontend:1.0.4.RC_01]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.page.PartialPageUpdate.prepareComponent(PartialPageUpdate.java:322)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:250)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:162)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:384)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)[136:org.apa
> >>>>>>>>> che.wicket.core:8.1.0] at
> >>>>>>>>>
> >>
> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)[139:org.apache.wicket.request:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:262)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$processRequestCycle$6()[jar:bundle://128.0:0/!/:]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servic
> >>>>>>>>> emix.bundles.cglib:2.2.2.1] at
> >>>>>>>>>
> >>
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.intercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.processRequestCycle()[jar:bundle://128.0:0/!/:]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.CGLIB$doFilter$3()[jar:bundle://128.0:0/!/:]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322$$FastClassByCGLIB$$c4e730b8.invoke()[jar:bundle://128.0:0/!/:]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)[128:org.apache.servicemix.bundles.cglib:2.2.2.1]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet$WicketFilterCallback.int
> >>
> ercept(PAXWicketServlet.java:236)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.protocol.http.WicketFilter$$EnhancerByCGLIB$$a4862322.doFilter()[jar:bundle://128.0:0/!/:]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.ops4j.pax.wicket.internal.servlet.PAXWicketServlet.service(PAXWicketServlet.java:140)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.ops4j.pax.wicket.internal.filter.PAXWicketFilterChain.doFilter(PAXWicketFilterChain.java:71)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.ops4j.pax.wicket.internal.filter.FilterDelegator.doFilter(FilterDelegator.java:105)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.ops4j.pax.wicket.internal.servlet.ServletCallInterceptor.service(ServletCallInterceptor.java:179)[147:org.ops4j.pax.wicket.service:5.0.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>>>>>> at o
> >>>>>>>>>
> >>
> rg.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:201)[92:org.eclipse.jetty.websocket.server:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:72)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)[80:org.eclipse.jetty.security:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>>>> at org.eclipse.jetty.server.handler.Con
> >>>>>>>>>
> >>
> textHandler.doHandle(ContextHandler.java:1127)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:287)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[82:org.eclipse.jetty.servlet:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)[99:org.ops4j.pax.web.pax-web-jetty:4.3.4]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[81:org.e
> >>>>>>>>> clipse.jetty.server:9.2.21.v20170120] at
> >>>>>>>>>
> >>
> org.eclipse.jetty.server.Server.handle(Server.java:499)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>>>>     at
> >>>>>>>>>
> >>
> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)[81:org.eclipse.jetty.server:9.2.21.v20170120]
> >>>>>>>>> at org.eclipse.jetty.io
> >>>>>>>>> .AbstractConnection$2.run(AbstractConnection.java:544)[73:
> >>>>>>>>> org.eclipse.jetty.io:9 .2.21.v20170120] at
> >>>>>>>>>
> >>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[84:org.eclipse.jetty.util:9.2.21.v20170120]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)[84:org.eclipse.jetty.util:9.2.21.v20170120]
> >>>>>>>>> at java.lang.Thread.run(Unknown Source)[:1.8.0_111] Caused by:
> >>>>>>>>> java.lang.IllegalStateException: Components can no longer be
> added
> >> at
> >>
> org.apache.wicket.page.PartialPageUpdate.assertNotFrozen(PartialPageUpdate.java:858)[136:org.apache.wick
> >>>>>>>>> et.core:8.1.0] at
> >>>>>>>>>
> >>
> org.apache.wicket.page.PartialPageUpdate.assertComponentsNotFrozen(PartialPageUpdate.java:851)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.page.PartialPageUpdate.add(PartialPageUpdate.java:448)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:264)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.ajax.AjaxRequestHandler.add(AjaxRequestHandler.java:240)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:122)
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree$1.component(NestedTree.java:115)
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)[140:org.apache.wicket.util:8.1.0]
> >>>>>>>>> a
> >>>>>>>>> t
> >>>>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:960)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.NestedTree.updateBranch(NestedTree.java:114)
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.lambda$expand$0(AbstractTree.java:159)[137:org.apache.wicket.extensions:8.1.0]
> >>>>>>>>> at java.util.Optional.ifPresent(Unknown Source)[:1.8.0_111]   at
> >>>>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.expand(AbstractTree.java:158)[137:org.apache.wicket.extensions:8.1.0]
> >>>>>>>>> * at
> >>>>>>>>>
> >>
> dk.netdesign.XXX.frontend.page.SupervisorPage$14.newContentComponent(SupervisorPage.java:443)[106:XXX-frontend:1.0.4.RC_01]*
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree$1.createContent(AbstractTree.java:236)[137:org.apache.wicket.extensions:8.1.0]
> >>>>>>>>> at org.apache.wicket.extensions.markup.html.repe
> >>>>>>>>>
> >>
> ater.tree.Node.onInitialize(Node.java:86)[137:org.apache.wicket.extensions:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.Component.fireInitialize(Component.java:871)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1043)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:1039)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)[140:org.apache.wicket.util:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)[140:org.apache.wicket.util:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)[140:org.apache.wicket.util:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:975)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1038)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at org.apache.wicket.MarkupContainer.addedComponent(Mark
> >>>>>>>>> upContainer.java:1014)[136:org.apache.wicket.core:8.1.0] at
> >>>>>>>>>
> >>
> org.apache.wicket.MarkupContainer.add(MarkupContainer.java:239)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:191)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:97)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:124)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.Component.beforeRender(Component.java:937)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> at
> >>>>>>>>>
> >>
> org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1753)[136:org.apache.wicket.core:8.1.0]
> >>>>>>>>> ... 56 more -- Best regards / Med venlig hilsen Nino Martinez
> >>>>>>>> --
> >>>>>>>> Best regards / Med venlig hilsen
> >>>>>>>> Nino Martinez
> >>>>>>>>
> >>>>>>> --
> >>>>>>> Best regards / Med venlig hilsen
> >>>>>>> Nino Martinez
> >>>>>>>
> >>>>>> --
> >>>>>> Best regards / Med venlig hilsen
> >>>>>> Nino Martinez
> >>>>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: [hidden email]
> >>>> For additional commands, e-mail: [hidden email]
> >>>>
> >>>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Best regards / Med venlig hilsen
Nino Martinez