use of org.apache.wicket.ajax.markup.html.AjaxLink in project midpoint by Evolveum.
the class PageAccounts method initLinks.
private void initLinks(Form form, Form accForm) {
AjaxSubmitLink listSyncDetails = new AjaxSubmitLink(ID_LIST_SYNC_DETAILS) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
listSyncDetailsPerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target, Form<?> form) {
target.add(getFeedbackPanel());
}
};
form.add(listSyncDetails);
AjaxSubmitLink export = new AjaxSubmitLink(ID_EXPORT) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
exportPerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target, Form<?> form) {
target.add(getFeedbackPanel());
}
};
form.add(export);
AjaxLink clearExport = new AjaxLink(ID_CLEAR_EXPORT) {
@Override
public void onClick(AjaxRequestTarget target) {
clearExportPerformed(target);
}
};
accForm.add(clearExport);
}
use of org.apache.wicket.ajax.markup.html.AjaxLink in project midpoint by Evolveum.
the class ChangePasswordPanel method initLayout.
private void initLayout(final boolean oldPasswordVisible) {
model = (LoadableModel<MyPasswordsDto>) getModel();
Label oldPasswordLabel = new Label(ID_OLD_PASSWORD_LABEL, createStringResource("PageSelfCredentials.oldPasswordLabel"));
add(oldPasswordLabel);
oldPasswordLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return oldPasswordVisible;
}
});
Label passwordLabel = new Label(ID_PASSWORD_LABEL, createStringResource("PageSelfCredentials.passwordLabel1"));
add(passwordLabel);
PasswordTextField oldPasswordField = new PasswordTextField(ID_OLD_PASSWORD_FIELD, new PropertyModel<String>(model, MyPasswordsDto.F_OLD_PASSWORD));
oldPasswordField.setRequired(false);
oldPasswordField.setResetPassword(false);
add(oldPasswordField);
oldPasswordField.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
public boolean isVisible() {
return oldPasswordVisible;
}
;
});
PasswordPanel passwordPanel = new PasswordPanel(ID_PASSWORD_PANEL, new PropertyModel<ProtectedStringType>(model, MyPasswordsDto.F_PASSWORD));
passwordPanel.getBaseFormComponent().add(new AttributeModifier("autofocus", ""));
add(passwordPanel);
WebMarkupContainer accountContainer = new WebMarkupContainer(ID_ACCOUNTS_CONTAINER);
List<IColumn<PasswordAccountDto, String>> columns = initColumns();
ListDataProvider<PasswordAccountDto> provider = new ListDataProvider<PasswordAccountDto>(this, new PropertyModel<List<PasswordAccountDto>>(model, MyPasswordsDto.F_ACCOUNTS));
TablePanel accounts = new TablePanel(ID_ACCOUNTS_TABLE, provider, columns);
accounts.setItemsPerPage(30);
accounts.setShowPaging(false);
if (model.getObject().getPropagation() != null && model.getObject().getPropagation().equals(CredentialsPropagationUserControlType.MAPPING)) {
accountContainer.setVisible(false);
}
accountContainer.add(accounts);
AjaxLink help = new AjaxLink(ID_BUTTON_HELP) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
showHelpPerformed(target);
}
};
accountContainer.add(help);
add(accountContainer);
}
use of org.apache.wicket.ajax.markup.html.AjaxLink in project midpoint by Evolveum.
the class ChooseTypePanel method initLayout.
protected void initLayout() {
final Label name = new Label(ID_OBJECT_NAME, new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
ObjectViewDto<T> dto = getModel().getObject();
if (dto != null) {
if (dto.getName() != null)
return getModel().getObject().getName();
else if (ObjectViewDto.BAD_OID.equals(dto.getOid())) {
return createStringResource("chooseTypePanel.ObjectNameValue.badOid").getString();
} else {
return createStringResource("chooseTypePanel.ObjectNameValue.null").getString();
}
}
return "";
}
});
name.setOutputMarkupId(true);
AjaxLink<String> choose = new AjaxLink<String>(ID_LINK_CHOOSE) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
changeOptionPerformed(target);
}
};
AjaxLink<String> remove = new AjaxLink<String>(ID_LINK_REMOVE) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
setToDefault();
target.add(name);
}
};
add(choose);
add(remove);
add(name);
}
use of org.apache.wicket.ajax.markup.html.AjaxLink in project midpoint by Evolveum.
the class ObjectPolicyPanel method initButtons.
private void initButtons(WebMarkupContainer buttonGroup, final ListItem item) {
AjaxLink add = new AjaxLink(ID_BUTTON_ADD) {
@Override
public void onClick(AjaxRequestTarget target) {
addPerformed(target);
}
};
add.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return isAddButtonVisible(item);
}
});
buttonGroup.add(add);
AjaxLink remove = new AjaxLink(ID_BUTTON_REMOVE) {
@Override
public void onClick(AjaxRequestTarget target) {
removePerformed(target, item);
}
};
remove.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return isRemoveButtonVisible();
}
});
buttonGroup.add(remove);
}
use of org.apache.wicket.ajax.markup.html.AjaxLink in project midpoint by Evolveum.
the class H3Header method initLayout.
@Override
protected void initLayout() {
Label title = new Label(ID_TITLE, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getDisplayName();
}
});
add(title);
final IModel<List<InlineMenuItem>> items = new Model((Serializable) createMenuItems());
BootstrapLabel status = new BootstrapLabel(ID_STATUS, createStringResource("H3Header.label.error"), new Model(BootstrapLabel.State.DANGER));
status.add(createFetchErrorVisibleBehaviour());
add(status);
AjaxLink showMore = new AjaxLink(ID_SHOW_MORE) {
@Override
public void onClick(AjaxRequestTarget target) {
onShowMorePerformed(target);
}
};
showMore.add(createFetchErrorVisibleBehaviour());
add(showMore);
}
Aggregations