//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?
Assuming that MessageDialog is from Wicket JQuery UI library then you can just do
trainingDialog.setModelObject("New message")
.