private static final long serialVersionUID = -7834632442532690940L;
@Override
public Page createPage() {
return new RoleSelectModalPage(getPage().getPageReference(), parentSelectWin,
ParentSelectPayload.class);
}
});
parentSelectWin.show(target);
}
};
parentFragment.add(parentSelect);
final IndicatingAjaxLink<Void> parentReset = new IndicatingAjaxLink<Void>("parentReset") {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target) {
parentModel.setObject(null);
target.add(parent);
}
};
parentFragment.add(parentReset);
} else {
parentFragment = new Fragment("parent", "emptyFragment", this);
}
parentFragment.setOutputMarkupId(true);
this.add(parentFragment);
final AjaxTextFieldPanel name =
new AjaxTextFieldPanel("name", "name", new PropertyModel<String>(roleTO, "name"));
final WebMarkupContainer jexlHelp = JexlHelpUtil.getJexlHelpWebContainer("jexlHelp");
final AjaxLink questionMarkJexlHelp = JexlHelpUtil.getAjaxLink(jexlHelp, "questionMarkJexlHelp");
this.add(questionMarkJexlHelp);
questionMarkJexlHelp.add(jexlHelp);
if (!templateMode) {
name.addRequiredLabel();
questionMarkJexlHelp.setVisible(false);
}
this.add(name);
userOwnerModel = new OwnerModel(roleTO, AttributableType.USER);
@SuppressWarnings("unchecked")
final AjaxTextFieldPanel userOwner = new AjaxTextFieldPanel("userOwner", "userOwner", userOwnerModel);
userOwner.setReadOnly(true);
userOwner.setOutputMarkupId(true);
ownerContainer.add(userOwner);
final AjaxLink<Void> userOwnerSelect = new IndicatingAjaxLink<Void>("userOwnerSelect") {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target) {
userOwnerSelectWin.setPageCreator(new ModalWindow.PageCreator() {
private static final long serialVersionUID = -7834632442532690940L;
@Override
public Page createPage() {
return new UserOwnerSelectModalPage(getPage().getPageReference(), userOwnerSelectWin);
}
});
userOwnerSelectWin.show(target);
}
};
ownerContainer.add(userOwnerSelect);
final IndicatingAjaxLink<Void> userOwnerReset = new IndicatingAjaxLink<Void>("userOwnerReset") {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target) {
userOwnerModel.setObject(null);
target.add(userOwner);
}
};
ownerContainer.add(userOwnerReset);
roleOwnerModel = new OwnerModel(roleTO, AttributableType.ROLE);
@SuppressWarnings("unchecked")
final AjaxTextFieldPanel roleOwner = new AjaxTextFieldPanel("roleOwner", "roleOwner", roleOwnerModel);
roleOwner.setReadOnly(true);
roleOwner.setOutputMarkupId(true);
ownerContainer.add(roleOwner);
final AjaxLink<Void> roleOwnerSelect = new IndicatingAjaxLink<Void>("roleOwnerSelect") {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target) {
parentSelectWin.setPageCreator(new ModalWindow.PageCreator() {
private static final long serialVersionUID = -7834632442532690940L;
@Override
public Page createPage() {
return new RoleSelectModalPage(getPage().getPageReference(), parentSelectWin,
RoleOwnerSelectPayload.class);
}
});
parentSelectWin.show(target);
}