{
}
};
copyForm.add(copyIdsChkBox);
AjaxButton copyButton = new AjaxButton("copy",new ResourceModel("common.copy"),copyForm)
{
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form)
{
docAction(true, docOldName, getDocName(), docOldPath, getDocPath(), getCopyIds());
((ModalWindow) CopyMoveWindow.this.getParent()).close(target);
}
@Override
protected void onError(AjaxRequestTarget target, Form<?> form)
{
target.addComponent(feedback);
}
};
AjaxButton moveButton = new AjaxButton("move",new ResourceModel("common.move"), copyForm)
{
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form)
{
docAction(false, docOldName, getDocName(), docOldPath, getDocPath(), getCopyIds());
((ModalWindow) CopyMoveWindow.this.getParent()).close(target);
}
@Override
protected void onError(AjaxRequestTarget target, Form<?> form)
{
target.addComponent(feedback);
}
};
copyButton.setVisibilityAllowed(true);
moveButton.setVisibilityAllowed(true);
copyForm.add(copyButton);
copyForm.add(moveButton);
if (copyFlag)
{
copyButton.setVisible(true);
moveButton.setVisible(false);
}
else
{
copyButton.setVisible(false);
moveButton.setVisible(true);
}
setCopyIds(!copyFlag);
// Adding menu tree node