@Override
protected void onInitialize()
{
super.onInitialize();
if (showModalDialog == true && getPage() != null && getPage() instanceof AbstractSecuredPage) {
final AbstractSecuredPage parentPage = (AbstractSecuredPage) getPage();
modalDialog = new ModalDialog(parentPage.newModalDialogId()) {
@Override
public void init()
{
setTitle(getString("changes"));
init(new Form<String>(getFormId()));
{
final FieldsetPanel fs = gridBuilder.newFieldset(getString("history.oldValue")).setLabelSide(false);
final TextArea<String> textArea = new TextArea<String>(fs.getTextAreaId(), oldText);
fs.add(textArea).setAutogrow(1, 10);
textArea.add(AttributeModifier.replace("onClick", "$(this).select();"));
}
{
final FieldsetPanel fs = gridBuilder.newFieldset(getString("history.newValue")).setLabelSide(false);
final TextArea<String> textArea = new TextArea<String>(fs.getTextAreaId(), newText);
fs.add(textArea).setAutogrow(1, 10);
textArea.add(AttributeModifier.replace("onClick", "$(this).select();"));
}
}
};
modalDialog.setBigWindow();
modalDialog.setLazyBinding();
parentPage.add(modalDialog);
final AjaxEventBehavior behavior = new AjaxEventBehavior("onClick") {
@Override
protected void onEvent(final AjaxRequestTarget target)
{
if (modalDialog.isBound() == false) {