【问题标题】:Updating the message contents for a MessageDialog wicket更新 MessageDialog 检票口的消息内容
【发布时间】:2015-06-08 17:40:05
【问题描述】:
        //TrainingDialog associated with save button
        trainingDialog = new MessageDialog("trainingdialog", "Warning", "Message contents here",
                DialogButtons.OK, DialogIcon.WARN) {
            public void onClose(AjaxRequestTarget target, DialogButton button) {
                if (button != null && button.match(LBL_OK)) {
                    target.prependJavaScript("return saveClick()");
                    saveButton.add(new AttributeModifier("onclick", "return saveClick()"));
                    target.add(saveButton);
                    //note: predefined button text are:
                    //LBL_OK, LBL_CANCEL, LBL_YES, LBL_NO, LBL_CLOSE, LBL_SUBMIT
                }
            }
        }; 


        add(trainingDialog);

现在在我显示对话框之前使用 trainingdialog.open(目标)

有没有办法更新对话框的内容?

【问题讨论】:

    标签: java jakarta-ee wicket


    【解决方案1】:

    假设 MessageDialog 来自 Wicket JQuery UI 库,那么您可以执行 trainingDialog.setModelObject("New message")

    【讨论】:

      猜你喜欢
      • 2018-01-16
      • 1970-01-01
      • 1970-01-01
      • 2014-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多