use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.
the class AssociationValueChoicePanel method initUserOrgDialog.
private void initUserOrgDialog() {
final ModalWindow dialog = new ModalWindow(MODAL_ID_OBJECT_SELECTION_POPUP);
ObjectSelectionPanel.Context context = new ObjectSelectionPanel.Context(this) {
private static final long serialVersionUID = 1L;
// See analogous discussion in ChooseTypePanel
public AssociationValueChoicePanel getRealParent() {
return WebComponentUtil.theSameForPage(AssociationValueChoicePanel.this, getCallingPageReference());
}
@Override
public void chooseOperationPerformed(AjaxRequestTarget target, ObjectType object) {
getRealParent().choosePerformed(target, object);
}
@Override
public boolean isSearchEnabled() {
return true;
}
@Override
public Class<? extends ObjectType> getObjectTypeClass() {
return UserType.class;
}
@Override
protected WebMarkupContainer createExtraContentContainer(String extraContentId, final ObjectSelectionPanel objectSelectionPanel) {
return new UserOrgReferenceChoosePanel(extraContentId, Boolean.FALSE) {
@Override
protected void onReferenceTypeChangePerformed(AjaxRequestTarget target, Boolean newValue) {
objectSelectionPanel.updateTableByTypePerformed(target, Boolean.FALSE.equals(newValue) ? UserType.class : OrgType.class);
}
};
}
};
ObjectSelectionPage.prepareDialog(dialog, context, this, "chooseTypeDialog.title", ID_TEXT_WRAPPER);
add(dialog);
}
use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.
the class AssignmentTablePanel method addSelectedAssignablePerformed.
protected void addSelectedAssignablePerformed(AjaxRequestTarget target, List<ObjectType> newAssignments, String popupId) {
ModalWindow window = (ModalWindow) get(popupId);
if (window != null) {
window.close(target);
}
getPageBase().hideMainPopup(target);
if (newAssignments.isEmpty()) {
warn(getNoAssignmentsSelectedMessage());
target.add(getPageBase().getFeedbackPanel());
return;
}
List<AssignmentEditorDto> assignments = getAssignmentModel().getObject();
for (ObjectType object : newAssignments) {
try {
if (object instanceof ResourceType) {
addSelectedResourceAssignPerformed((ResourceType) object);
continue;
}
if (object instanceof UserType) {
AssignmentEditorDto dto = AssignmentEditorDto.createDtoAddFromSelectedObject(object, SchemaConstants.ORG_DEPUTY, getPageBase());
assignments.add(dto);
} else {
AssignmentEditorDto dto = AssignmentEditorDto.createDtoAddFromSelectedObject(object, getPageBase());
assignments.add(dto);
}
} catch (Exception e) {
error(getString("AssignmentTablePanel.message.couldntAssignObject", object.getName(), e.getMessage()));
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't assign object", e);
}
}
reloadAssignmentsPanel(target);
}
use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.
the class ResourceActivationEditor method initModals.
private void initModals(NonEmptyModel<Boolean> readOnlyModel) {
ModalWindow mappingEditor = new MappingEditorDialog(ID_MODAL_MAPPING, null, readOnlyModel) {
@Override
public void updateComponents(AjaxRequestTarget target) {
target.add(ResourceActivationEditor.this);
}
};
add(mappingEditor);
}
use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.
the class ResourceIterationEditor method initModals.
private void initModals() {
ModalWindow variableEditor = new ExpressionVariableEditorDialog(ID_VARIABLE_EDITOR_MODAL, null) {
@Override
public void updateComponents(AjaxRequestTarget target) {
target.add(ResourceIterationEditor.this.get(ID_POST_VARIABLE_LIST), ResourceIterationEditor.this.get(ID_PRE_VARIABLE_LIST), ResourceIterationEditor.this.get(ID_TOKEN_VARIABLE_LIST));
}
};
add(variableEditor);
}
use of org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow in project midpoint by Evolveum.
the class FocusProjectionsTabPanel method getDeleteProjectionPopupContent.
private Popupable getDeleteProjectionPopupContent() {
ConfirmationPanel dialog = new ConfirmationPanel(getPageBase().getMainPopupBodyId(), new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return createStringResource("pageAdminFocus.message.deleteAccountConfirm", getSelectedProjections(projectionModel).size()).getString();
}
}) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
ModalWindow modalWindow = findParent(ModalWindow.class);
if (modalWindow != null) {
modalWindow.close(target);
deleteAccountConfirmedPerformed(target, getSelectedProjections(projectionModel));
}
}
};
return dialog;
}
Aggregations