You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by zoran <je...@gmail.com> on 2010/07/18 13:17:26 UTC
getPage() and getParentPage() returns null
Hi,
I have one basic page in my application that contains a base panel. This
panel contains several AjaxLinks that update the panel content, so new page
is loaded for each link. This works fine, but each of these pages can't
access it's parent page or page with getParentPage() and getPage(). The
result is null.
I found this because I wanted to add additional panel to one of these pages,
and there I got error like this:
Caused by: java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = contentPanel]]
at org.apache.wicket.Component.getPage(Component.java:1756)
at
org.intelleo.webui.lpc.PLKMBasePanel.getParentPage(PLKMBasePanel.java:145)
Is there some way to set this page?
Thanks
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/getPage-and-getParentPage-returns-null-tp2293003p2293003.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: getPage() and getParentPage() returns null
Posted by "robert.mcguinness" <ro...@gmail.com>.
FYI in version 1.4.10 the API gets more clean:
http://apache-wicket.1842946.n4.nabble.com/new-feature-in-trunk-and-branch-Component-onInitialize-td2286924.html#a2286924
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/getPage-and-getParentPage-returns-null-tp2293003p2293437.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: getPage() and getParentPage() returns null
Posted by zoran <je...@gmail.com>.
Robert,
This works :)
I just removed initialization of the components from the constructor and it
works now.
Thanks.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/getPage-and-getParentPage-returns-null-tp2293003p2293379.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: getPage() and getParentPage() returns null
Posted by zoran <je...@gmail.com>.
Hi Robert,
I tried this, but this doesn't work or I didn't get idea. If I add this then
I got exception saying that component with that id already exists.
I've attached the whole code, but the hierarchy of pages that makes a
problem are like this:
PLKMBasePage
PLKMBasePanel
PreviewGoals
CompetencePanel
Do you have some idea?
Zoran
http://apache-wicket.1842946.n4.nabble.com/file/n2293370/lpc.zip lpc.zip
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/getPage-and-getParentPage-returns-null-tp2293003p2293370.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: getPage() and getParentPage() returns null
Posted by "robert.mcguinness" <ro...@gmail.com>.
i need to see more code but try constructing your panels like:
@Override
protected void onBeforeRender() {
if (!hasBeenRendered()) {
// call some function that builds/add components here
}
super.onBeforeRender();
}
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/getPage-and-getParentPage-returns-null-tp2293003p2293306.html
Sent from the Wicket - User mailing list archive at Nabble.com.