use of org.apache.syncope.client.console.wicket.ajax.markup.html.IndicatorAjaxSubmitLink in project syncope by apache.
the class AbstractMultiPanel method getPlusFragment.
private Fragment getPlusFragment(final IModel<List<INNER>> model, final String label) {
final IndicatorAjaxSubmitLink plus = new IndicatorAjaxSubmitLink("add") {
private static final long serialVersionUID = -7978723352517770644L;
@Override
protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
// Add current component
model.getObject().add(newModelObject());
if (model.getObject().size() == 1) {
form.addOrReplace(getDataFragment());
}
target.add(container);
}
@Override
protected void onError(final AjaxRequestTarget target, final Form<?> form) {
SyncopeConsoleSession.get().error(getString(Constants.OPERATION_ERROR));
super.onError(target, form);
((BasePage) getPage()).getNotificationPanel().refresh(target);
}
};
final Fragment fragment = new Fragment("panelPlus", "fragmentPlus", AbstractMultiPanel.this);
fragment.addOrReplace(plus);
fragment.setRenderBodyOnly(true);
return fragment;
}
Aggregations