use of org.apache.wicket.ajax.AjaxRequestTarget in project midpoint by Evolveum.
the class PageSelfRegistration method initLayout.
private void initLayout() {
final Form<?> mainForm = new Form<>(ID_MAIN_FORM);
initAccessBehaviour(mainForm);
add(mainForm);
addMultilineLable(ID_WELCOME, "PageSelfRegistration.welcome.message", mainForm);
addMultilineLable(ID_ADDITIONAL_TEXT, "PageSelfRegistration.additional.message", mainForm);
initStaticFormLayout(mainForm);
initDynamicFormLayout(mainForm);
CaptchaPanel captcha = new CaptchaPanel(ID_CAPTCHA);
captcha.setOutputMarkupId(true);
mainForm.add(captcha);
AjaxSubmitButton register = new AjaxSubmitButton(ID_SUBMIT_REGISTRATION) {
private static final long serialVersionUID = 1L;
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
showErrors(target);
}
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
submitRegistration(target);
}
};
mainForm.add(register);
MultiLineLabel label = new MultiLineLabel(ID_REGISTRATION_SUBMITED, createStringResource("PageSelfRegistration.registration.confirm.message"));
add(label);
label.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return submited;
}
@Override
public boolean isEnabled() {
return submited;
}
});
AjaxButton back = new AjaxButton(ID_BACK) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
setResponsePage(PageLogin.class);
}
};
mainForm.add(back);
}
use of org.apache.wicket.ajax.AjaxRequestTarget in project midpoint by Evolveum.
the class OrgUnitAddDeletePopup method initLayout.
public void initLayout(WebMarkupContainer content) {
List<IColumn<SelectableBean<ObjectType>, String>> columns = initColumns();
ObjectDataProvider provider = new ObjectDataProvider(getPageBase(), OrgType.class);
provider.setQuery(getDataProviderQuery());
TablePanel table = new TablePanel<SelectableBean<ObjectType>>(ID_TABLE, provider, columns);
table.setOutputMarkupId(true);
content.add(table);
AjaxButton cancelButton = new AjaxButton(ID_BUTTON_CANCEL, createStringResource("orgUnitAddDeletePopup.button.cancel")) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
cancelPerformed(ajaxRequestTarget);
}
};
content.add(cancelButton);
AjaxButton actionButton = new AjaxButton(ID_BUTTON_ACTION, createActionButtonStringResource()) {
@Override
public void onClick(AjaxRequestTarget target) {
actionPerformed(target);
}
};
actionButton.add(new AttributeAppender("class", getActionButtonClass()));
content.add(actionButton);
}
use of org.apache.wicket.ajax.AjaxRequestTarget in project midpoint by Evolveum.
the class TreeTablePanel method initLayout.
protected void initLayout() {
OrgTreePanel treePanel = new OrgTreePanel(ID_TREE_PANEL, getModel(), false) {
private static final long serialVersionUID = 1L;
@Override
protected void selectTreeItemPerformed(SelectableBean<OrgType> selected, AjaxRequestTarget target) {
TreeTablePanel.this.selectTreeItemPerformed(selected, target);
}
protected List<InlineMenuItem> createTreeMenu() {
return TreeTablePanel.this.createTreeMenu();
}
@Override
protected List<InlineMenuItem> createTreeChildrenMenu(OrgType org) {
return TreeTablePanel.this.createTreeChildrenMenu(org);
}
};
treePanel.setOutputMarkupId(true);
add(treePanel);
add(createMemberPanel(treePanel.getSelected().getValue()));
setOutputMarkupId(true);
}
use of org.apache.wicket.ajax.AjaxRequestTarget in project midpoint by Evolveum.
the class PageWorkItems method initItemButtons.
private void initItemButtons(Form mainForm) {
AjaxButton claim = new AjaxButton("claim", createStringResource("pageWorkItems.button.claim")) {
@Override
public void onClick(AjaxRequestTarget target) {
claimWorkItemsPerformed(target);
}
};
claim.setVisible(!all && claimable);
mainForm.add(claim);
AjaxButton release = new AjaxButton("release", createStringResource("pageWorkItems.button.release")) {
@Override
public void onClick(AjaxRequestTarget target) {
releaseWorkItemsPerformed(target);
}
};
release.setVisible(!all && !claimable);
mainForm.add(release);
// the following are shown irrespectively of whether the work item is assigned or not
AjaxButton approve = new AjaxButton("approve", createStringResource("pageWorkItems.button.approve")) {
@Override
public void onClick(AjaxRequestTarget target) {
approveOrRejectWorkItemsPerformed(target, true);
}
};
mainForm.add(approve);
AjaxButton reject = new AjaxButton("reject", createStringResource("pageWorkItems.button.reject")) {
@Override
public void onClick(AjaxRequestTarget target) {
approveOrRejectWorkItemsPerformed(target, false);
}
};
mainForm.add(reject);
}
use of org.apache.wicket.ajax.AjaxRequestTarget in project midpoint by Evolveum.
the class AbstractObjectMainPanel method initLayoutPreviewButton.
// TEMPORARY
protected void initLayoutPreviewButton(final PageAdminObjectDetails<O> parentPage) {
AjaxSubmitButton previewButton = new AjaxSubmitButton(ID_PREVIEW_CHANGES, parentPage.createStringResource("pageAdminFocus.button.previewChanges")) {
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
getDetailsPage().previewPerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
target.add(parentPage.getFeedbackPanel());
}
};
previewButton.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return AbstractObjectMainPanel.this.isPreviewButtonVisible();
}
@Override
public boolean isEnabled() {
PrismContainerDefinition def = getObjectWrapper().getDefinition();
if (ContainerStatus.MODIFYING.equals(getObjectWrapper().getStatus()) && !def.canModify()) {
return areSavePreviewButtonsEnabled();
}
return true;
}
});
mainForm.add(previewButton);
}
Aggregations