lundi 8 juin 2015

Updating the message contents for a MessageDialog wicket

        //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);

Now before I show the dialog using trainingdialog.open(target)

is there a way i can update the contents of the dialog?

Aucun commentaire:

Enregistrer un commentaire