Even simpler :) And thanks

However it had to be like this:

target.addChildren(*target.getPage()*, FeedbackPanel.class);

2012/2/10 Martin Grigorov <mgrigo...@apache.org>

> On Fri, Feb 10, 2012 at 10:09 AM, nino martinez wael
> <nino.martinez.w...@gmail.com> wrote:
> > fyi, it was as simple as changing it to this:
> >
> >
> > private void addAllFeedbackPanels(AjaxRequestTarget target) {
> >  ComponentHierarchyIterator visitChildren = *target.getPage()*
> > .visitChildren(FeedbackPanel.class);
> > for (Component component : visitChildren) {
> > target.add(component);
>
> target.addChildren(getPage(), FeedbackPanel.class);
>
> > }
> > }
> >
> >
> > 2012/2/9 nino martinez wael <nino.martinez.w...@gmail.com>
> >
> >> Doh and thanks again!
> >> On Feb 9, 2012 5:57 PM, "Igor Vaynberg" <igor.vaynb...@gmail.com>
> wrote:
> >>
> >>> youve removed "this" from page hierarchy so you can no longer say
> >>> this.getPage().
> >>>
> >>> call getPage() on the component that replaced "this"
> >>>
> >>> -igor
> >>>
> >>> On Thu, Feb 9, 2012 at 5:27 AM, nino martinez wael
> >>> <nino.martinez.w...@gmail.com> wrote:
> >>> > Hi I
> >>> >
> >>> > have a problem where I first call addOrReplace on a components parent
> >>> (in
> >>> > this case it replaces).
> >>> >
> >>> > And later in the same request I do this:
> >>> > ComponentHierarchyIterator visitChildren = this.getPage()
> >>> > .visitChildren(FeedbackPanel.class);
> >>> >
> >>> > However when the visitor above runs, it complains about that one of
> the
> >>> > components haven't got a page.
> >>> >
> >>> > org.apache.wicket.WicketRuntimeException: No Page found for component
> >>> > [ [Component id = saveButton]]
> >>> >     at org.apache.wicket.Component.getPage(Component.java:1765)
> >>> >     at
> >>>
> com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.addAllFeedbackPanels(TriggerSchedulePanel.java:1051)
> >>> >     at
> >>>
> com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.cannotRefreshFeedbackIfOutSideConfig(TriggerSchedulePanel.java:1047)
> >>> >     at
> >>>
> com.netdesign.ccadmin.panel.TriggerSchedulePanel$33.onSubmit(TriggerSchedulePanel.java:1033)
> >>> >     at
> >>>
> org.apache.wicket.ajax.markup.html.form.AjaxButton$1.onSubmit(AjaxButton.java:103)
> >>> >     at
> >>>
> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$1.onSubmit(AjaxFormSubmitBehavior.java:172)
> >>> >     at
> >>> org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1154)
> >>> >     at org.apache.wicket.markup.html.form.Form.process(Form.java:838)
> >>> >     at
> >>> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:762)
> >>> >     at
> >>>
> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:158)
> >>> >     at
> >>>
> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
> >>> >     at
> >>>
> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:316)
> >>> >     at java.lang.reflect.Method.invoke(Unknown Source)
> >>> >     at
> >>>
> org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:260)
> >>> >     at
> >>>
> org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
> >>> >     at
> >>>
> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:255)
> >>> >     at
> >>>
> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
> >>> >     at
> >>>
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
> >>> >     at
> >>>
> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
> >>> >     at
> >>>
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
> >>> >     at
> >>>
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
> >>> >     at
> >>>
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
> >>> >     at
> >>>
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
> >>> >     at
> >>>
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
> >>> >     at
> >>>
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> >>> >     at
> >>>
> com.netdesign.ccadmin.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
> >>> >     at
> >>>
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> >>> >     at
> >>>
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
> >>> >     at
> >>>
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> >>> >     at
> >>>
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> >>> >     at
> >>>
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> >>> >     at
> >>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
> >>> >     at
> >>>
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> >>> >     at org.mortbay.jetty.Server.handle(Server.java:326)
> >>> >     at
> >>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> >>> >     at
> >>>
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
> >>> >     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
> >>> >     at
> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> >>> >     at
> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> >>> >     at
> >>>
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
> >>> >     at
> >>>
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >>> For additional commands, e-mail: users-h...@wicket.apache.org
> >>>
> >>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to