I am trying to add a clickable link to my message dialog
//TrainingDialog associated with save button
trainingDialog = new MessageDialog("trainingdialog", "Warning",
"",
DialogButtons.OK, DialogIcon.WARN) {
public void onClose(AjaxRequestTarget target, DialogButton
button) {
if (button != null && button.match(LBL_OK)) {
//note: predefined button text are:
//LBL_OK, LBL_CANCEL, LBL_YES, LBL_NO, LBL_CLOSE,
LBL_SUBMIT
}
}
};
add(trainingDialog);
//Method displays dialog
public void initiateTrainingMode() {
try {
//Training mode logic
if (trainingmode()){
final String com = trainingEvalService.getMessage();
final AjaxLink link1 = new AjaxLink("link1") {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
}
};
AjaxEventBehavior event = new AjaxEventBehavior("onload") {
@Override
protected void onEvent(final AjaxRequestTarget target) {
// Display popup
if (com.length() > 0){
trainingDialog.setModelObject(com);
* trainingDialog.add(link1);*
trainingDialog.open(target);
trainingEvalService.setMessage("");
}
}
};
add(event);
}
}
catch (NullPointerException e){
LOG.debug("NullPointer was caught " + e.getMessage());
}
}
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Add-a-link-to-MessageDialog-tp4671115.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]