Wicket:打开ModalWindow时出现崩溃(弹出窗口)

时间:2010-03-11 09:30:26

标签: java wicket

在Wicket Panel中,我实现了一个名为showAttentiePopup(AjaxRequestTarget)的方法,该方法显示了一个ModalWindow弹出屏幕。当我从同一个Panel调用它时,此方法正常工作。但是当我尝试从另一个Panel调用该方法时,它崩溃并出现以下错误:

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.apache.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)

有人知道问题可能是什么?

方法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);      
   }

问候, 瑞克

1 个答案:

答案 0 :(得分:0)

您的堆栈跟踪表明ModalWindow createAttentie在您的代码尝试呈现时不属于页面。

跟踪页面构造逻辑和组件结构,确保所有内容都正确连接在一起。