"menuOptions"))
{
public void populateItem(final ListItem listItem)
{
final MenuExcludeDefinition option = (MenuExcludeDefinition) listItem
.getModelObject();
listItem.add(new Label("name", option.getName()));
AjaxLink editLink = new AjaxLink("edit")
{
@Override
public void onClick(AjaxRequestTarget target)
{
metaDataModalWindow.setContent(new ExcludesWindow(
metaDataModalWindow.getContentId(),option, ajaxPanel));
metaDataModalWindow.show(target);
}
};
editLink.add(new Label("editLabel",new ResourceModel("common.edit")));
listItem.add(editLink);
AjaxLink deleteLink = new AjaxLink("delete")
{
@Override
public void onClick(AjaxRequestTarget target)
{
menuActions(REMOVE_ACTION,option.getName(), new ExcludesDefinitionBean());
target.addComponent(ajaxPanel);
}
};
deleteLink.add(new JavascriptEventConfirmation("onclick",
new ResourceModel("action.delete.confirm")));
deleteLink.add(new Label("deleteLabel",new ResourceModel("common.delete")));
listItem.add(deleteLink);
}
});
Form excludeForm = new Form("excludeForm");
add(excludeForm);
add(new AjaxButton("new",new ResourceModel("common.new"),excludeForm)
{
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form)
{
MenuExcludeDefinition excludeDefinition = null;
if (getUserSelectedNode().getDocType() == FileType.Folder)
{
excludeDefinition = getServiceLocator()
.getPageManager()
.newFolderMenuExcludeDefinition();