<tfoot id='J5eFU'></tfoot>
    • <bdo id='J5eFU'></bdo><ul id='J5eFU'></ul>

    <legend id='J5eFU'><style id='J5eFU'><dir id='J5eFU'><q id='J5eFU'></q></dir></style></legend>

    <i id='J5eFU'><tr id='J5eFU'><dt id='J5eFU'><q id='J5eFU'><span id='J5eFU'><b id='J5eFU'><form id='J5eFU'><ins id='J5eFU'></ins><ul id='J5eFU'></ul><sub id='J5eFU'></sub></form><legend id='J5eFU'></legend><bdo id='J5eFU'><pre id='J5eFU'><center id='J5eFU'></center></pre></bdo></b><th id='J5eFU'></th></span></q></dt></tr></i><div id='J5eFU'><tfoot id='J5eFU'></tfoot><dl id='J5eFU'><fieldset id='J5eFU'></fieldset></dl></div>

      <small id='J5eFU'></small><noframes id='J5eFU'>

        如何在 PageLoad 上打开 ModalDialog

        How to open ModalDialog on PageLoad(如何在 PageLoad 上打开 ModalDialog)
          <legend id='cKiwi'><style id='cKiwi'><dir id='cKiwi'><q id='cKiwi'></q></dir></style></legend>

          • <bdo id='cKiwi'></bdo><ul id='cKiwi'></ul>

              • <small id='cKiwi'></small><noframes id='cKiwi'>

              • <i id='cKiwi'><tr id='cKiwi'><dt id='cKiwi'><q id='cKiwi'><span id='cKiwi'><b id='cKiwi'><form id='cKiwi'><ins id='cKiwi'></ins><ul id='cKiwi'></ul><sub id='cKiwi'></sub></form><legend id='cKiwi'></legend><bdo id='cKiwi'><pre id='cKiwi'><center id='cKiwi'></center></pre></bdo></b><th id='cKiwi'></th></span></q></dt></tr></i><div id='cKiwi'><tfoot id='cKiwi'></tfoot><dl id='cKiwi'><fieldset id='cKiwi'></fieldset></dl></div>
                <tfoot id='cKiwi'></tfoot>
                    <tbody id='cKiwi'></tbody>
                  本文介绍了如何在 PageLoad 上打开 ModalDialog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何在 PageLoad() 的构造函数中打开一个模式对话框,在没有 AjaxRequestTarget 的情况下使用 Wicket?

                  How can I open a modal dialog on PageLoad(), in the constructor of the WebPage and without the AjaxRequestTarget, with Wicket?

                  推荐答案

                  如果没有 Ajax 请求,我找不到打开它的方法,但是完全可以在页面加载时打开它,只需一个简单的行为:

                  I couldn't find a way to open it without an Ajax request, but it's perfectly possible to open it when the page is loaded, with a simple behavior:

                  HomePage.java

                  HomePage.java

                  public class HomePage extends WebPage {
                      public HomePage(PageParameters pageParameters) {
                          super(pageParameters);
                  
                          ModalWindow modal = new ModalWindow("modal");
                          modal.add(new OpenWindowOnLoadBehavior());
                          modal.setPageCreator(new ModalWindow.PageCreator() {
                              @Override
                              public Page createPage() {
                                  return new RedirectPage("http://www.google.com");
                              }
                          });
                          add(modal);
                      }
                  }
                  

                  OpenWindowOnLoadBehavior.java

                  OpenWindowOnLoadBehavior.java

                  public class OpenWindowOnLoadBehavior extends AbstractDefaultAjaxBehavior {
                      @Override
                      protected void respond(AjaxRequestTarget target) {
                          ModalWindow window = (ModalWindow) getComponent();
                          window.show(target);
                      }
                      @Override
                      public void renderHead(IHeaderResponse response) {
                          response.renderOnLoadJavascript(getCallbackScript().toString());
                      }
                  }
                  

                  主页.html

                  <html xmlns:wicket="http://wicket.apache.org">
                  <body>
                    <div wicket:id="modal"></div>
                  </body>
                  </html>
                  

                  这篇关于如何在 PageLoad 上打开 ModalDialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                  <legend id='wDoFG'><style id='wDoFG'><dir id='wDoFG'><q id='wDoFG'></q></dir></style></legend>

                        <tfoot id='wDoFG'></tfoot>
                            <tbody id='wDoFG'></tbody>

                          <i id='wDoFG'><tr id='wDoFG'><dt id='wDoFG'><q id='wDoFG'><span id='wDoFG'><b id='wDoFG'><form id='wDoFG'><ins id='wDoFG'></ins><ul id='wDoFG'></ul><sub id='wDoFG'></sub></form><legend id='wDoFG'></legend><bdo id='wDoFG'><pre id='wDoFG'><center id='wDoFG'></center></pre></bdo></b><th id='wDoFG'></th></span></q></dt></tr></i><div id='wDoFG'><tfoot id='wDoFG'></tfoot><dl id='wDoFG'><fieldset id='wDoFG'></fieldset></dl></div>

                            <bdo id='wDoFG'></bdo><ul id='wDoFG'></ul>
                          • <small id='wDoFG'></small><noframes id='wDoFG'>