Ah, I did a target.addComponent on the replaced component. The parent of that component was set to null after the replaceWith, changing the addComponent to the newly created Panel works.
Thies Edeling wrote: > Some extra info, the No Page found for component happens when I try to > replace the Panel > in the onClick of an AjaxLink: > > public void onClick(AjaxRequestTarget target) > { > CalendarPanel panel = new CalendarPanel("sidePanel"); > getParent().replaceWith(panel); > target.addComponent(getParent()); > } > > Results in a: > > java.lang.IllegalStateException: No Page found for component [MarkupContainer > [Component id = sidePanel, page = <No Page>, path = sidePanel.CalendarPanel]] > at org.apache.wicket.Component.getPage(Component.java:1332) > at > org.apache.wicket.ajax.AjaxRequestTarget.respondComponent(AjaxRequestTarget.java:748) > at > org.apache.wicket.ajax.AjaxRequestTarget.respondComponents(AjaxRequestTarget.java:662) > > > gr, > Thies > > > Thies Edeling wrote: > >> I've got a panel extending the Panel class. When I add that panel to a >> Page, getPage can't seem to the find the parent and throws me a >> java.lang.IllegalStateException: No Page found for component >> [MarkupContainer [Component id = projectOverviewPanel, page = <No Page>, >> path = projectOverviewPanel.ProjectOverviewPanel]] >> >> I was assuming the Page was automatically set when the panel was added >> or am I mistaken ? >> >> gr, >> Thies >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Wicket-user mailing list >> Wicket-user@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wicket-user >> >> > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user