use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.
the class ResourceAttributeEditor method initModals.
private void initModals(NonEmptyModel<Boolean> readOnlyModel) {
ModalWindow limitationsEditor = new LimitationsEditorDialog(ID_MODAL_LIMITATIONS, new PropertyModel<List<PropertyLimitationsType>>(getModel(), "limitations"), readOnlyModel);
add(limitationsEditor);
ModalWindow inboundEditor = new MappingEditorDialog(ID_MODAL_INBOUND, null, readOnlyModel) {
@Override
public void updateComponents(AjaxRequestTarget target) {
target.add(ResourceAttributeEditor.this.get(ID_INBOUND), parentStep.getAttributeList());
}
};
add(inboundEditor);
ModalWindow outboundEditor = new MappingEditorDialog(ID_MODAL_OUTBOUND, null, readOnlyModel) {
@Override
public void updateComponents(AjaxRequestTarget target) {
target.add(ResourceAttributeEditor.this.get(ID_OUTBOUND_LABEL), ResourceAttributeEditor.this.get(ID_BUTTON_OUTBOUND), parentStep.getAttributeList());
}
};
add(outboundEditor);
}
use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.
the class AssignmentTablePanel method getDeleteAssignmentPopupContent.
private Popupable getDeleteAssignmentPopupContent() {
return new ConfirmationPanel(getPageBase().getMainPopupBodyId(), new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return getAssignmentsDeleteMessage(getSelectedAssignments().size());
}
}) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
ModalWindow modalWindow = findParent(ModalWindow.class);
if (modalWindow != null) {
modalWindow.close(target);
deleteAssignmentConfirmedPerformed(target, getSelectedAssignments());
reloadMainFormButtons(target);
}
}
};
}
use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.
the class PageCertCampaigns method getCloseCampaignConfirmationPanel.
private Popupable getCloseCampaignConfirmationPanel() {
return new ConfirmationPanel(getMainPopupBodyId(), createCloseCampaignConfirmString()) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
ModalWindow modalWindow = findParent(ModalWindow.class);
if (modalWindow != null) {
modalWindow.close(target);
closeCampaignConfirmedPerformed(target, relevantCampaign);
}
}
@Override
public StringResourceModel getTitle() {
return createStringResource("PageCertCampaigns.dialog.title.confirmCloseCampaign");
}
};
}
use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.
the class PageAccounts method initLayout.
private void initLayout() {
Form form = new Form(ID_MAIN_FORM);
form.setOutputMarkupId(true);
add(form);
Form accForm = new Form(ID_FORM_ACCOUNT);
accForm.setOutputMarkupId(true);
add(accForm);
Form searchForm = new Form(ID_SEARCH_FORM);
initSearchForm(searchForm);
searchForm.setOutputMarkupPlaceholderTag(true);
searchForm.setOutputMarkupId(true);
searchForm.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return resourceModel.getObject() != null;
}
});
add(searchForm);
DropDownChoice<ResourceItemDto> resources = new DropDownChoice<>(ID_RESOURCES, resourceModel, resourcesModel, new ChoiceableChoiceRenderer<ResourceItemDto>());
form.add(resources);
initLinks(form, accForm);
initTotals(form);
final AjaxDownloadBehaviorFromFile ajaxDownloadBehavior = new AjaxDownloadBehaviorFromFile(true) {
@Override
protected File initFile() {
return downloadFile;
}
};
ajaxDownloadBehavior.setRemoveFile(false);
form.add(ajaxDownloadBehavior);
WebMarkupContainer filesContainer = new WebMarkupContainer(ID_FILES_CONTAINER);
filesContainer.setOutputMarkupId(true);
accForm.add(filesContainer);
ModalWindow resultPopup = createModalWindow(ID_RESULT_DIALOG, createStringResource("PageAccounts.result.popoup"), 1100, 560);
resultPopup.setContent(new AceEditorDialog(resultPopup.getContentId()));
add(resultPopup);
filesModel = createFilesModel();
ListView<String> files = new ListView<String>(ID_FILES, filesModel) {
@Override
protected void populateItem(final ListItem<String> item) {
AjaxLink file = new AjaxLink(ID_FILE) {
@Override
public void onClick(AjaxRequestTarget target) {
downloadPerformed(target, item.getModelObject(), ajaxDownloadBehavior);
}
};
file.add(new Label(ID_FILE_NAME, item.getModelObject()));
item.add(file);
}
};
files.setRenderBodyOnly(true);
filesContainer.add(files);
WebMarkupContainer accountsContainer = new WebMarkupContainer(ID_ACCOUNTS_CONTAINER);
accountsContainer.setOutputMarkupId(true);
accForm.add(accountsContainer);
ObjectDataProvider provider = new ObjectDataProvider(this, ShadowType.class);
provider.setOptions(SelectorOptions.createCollection(GetOperationOptions.createRaw()));
provider.setQuery(ObjectQuery.createObjectQuery(createResourceQueryFilter()));
TablePanel accounts = new TablePanel(ID_ACCOUNTS, provider, createAccountsColumns(), UserProfileStorage.TableId.CONF_PAGE_ACCOUNTS, getItemsPerPage(UserProfileStorage.TableId.CONF_PAGE_ACCOUNTS));
accounts.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return resourceModel.getObject() != null;
}
});
accounts.setItemsPerPage(50);
accountsContainer.add(accounts);
}
use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.
the class PageAccounts method showShadowResult.
private void showShadowResult(AjaxRequestTarget target, IModel<SelectableBean> rowModel) {
OperationResultType result = getResult(rowModel);
String xml;
ModalWindow aceDialog = (ModalWindow) get(createComponentPath(ID_RESULT_DIALOG));
AceEditorDialog aceEditor = (AceEditorDialog) aceDialog.get(aceDialog.getContentId());
try {
xml = getPrismContext().xmlSerializer().serializeRealValue(result, ShadowType.F_RESULT);
aceEditor.updateModel(new Model<String>(xml));
} catch (SchemaException e) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't parse result", e);
aceEditor.updateModel(new Model<String>("Unable to show result. For more information see logs."));
}
aceDialog.show(target);
target.add(getFeedbackPanel());
}
Aggregations