Wicket: Crash when opening ModalWindow (Popup)
In a Wicket Panel i implemented a method called showAttentiePopup(AjaxRequestTarget) which shows an ModalWindow popup screen. This method works fine when i call it from the same Panel. But when I try to call the method from another Panel it crashes with the following error:
java.lang.IllegalStateException: No Page found for component [MarkupContainer [Component id = createAttentie]]
at org.apache.wicket.Component.getPage(Component.java:1665)
at org.apache.wicket.RequestCycle.urlFor(RequestCycle.java:851)
at org.apache.wicket.Component.urlFor(Component.java:3170)
at org.apache.wicket.behavior.AbstractAjaxBehavior.getCallbackUrl(AbstractAjaxBehavior.java:123)
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.getCallbackScript(AbstractDefaultAjaxBehavior.java:116)
at org.apa开发者_Go百科che.wicket.ajax.AbstractDefaultAjaxBehavior.getCallbackScript(AbstractDefaultAjaxBehavior.java:104)
at org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow$CloseButtonBehavior.getCallbackScript(ModalWindow.java:876)
at org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.getWindowOpenJavascript(ModalWindow.java:1005)
at org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.show(ModalWindow.java:286)
at nl.topicuszorg.fks.web.client.dossier.overzichten.documenten.AttentieOverzichtPanel.showAttentiePopup(AttentieOverzichtPanel.java:171)
at nl.topicuszorg.fks.web.client.dossier.overzichten.documenten.EditFileDocumentPanel$2.onSubmit(EditFileDocumentPanel.java:195)
at org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:94)
at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:128)
at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:163)
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:297)
Someone an idea what the problem might be?
The method showAttentiePopup:
public void showAttentiePopup(AjaxRequestTarget target) {
Component content = new EditAttentiePanel(createAttentie.getContentId(), new Attentie(), EditFunctie.AANMAKEN) {
/** */
private static final long serialVersionUID = 1L;
@Override
protected void annuleren(AjaxRequestTarget target) {
FKSModalWindow.closeCurrentWindow(target);
}
@Override
protected void opslaan(AjaxRequestTarget target, Attentie attentie) {
//Inhoud even weggelaten
}
};
createAttentie.setOutputMarkupId(true);
createAttentie.setInitialWidth(900);
createAttentie.setInitialHeight(450);
createAttentie.setTitle("Nieuwe Attentie Aanmaken");
createAttentie.setContent(content);
createAttentie.show(target);
}
Greetings, Rick
Your stack trace indicates the ModalWindow createAttentie is not part of a page at the time your code is trying to render it.
Trace through your page construction logic and component structure and make sure everything is wired together correctly.
精彩评论