Search in sources :

Example 1 with ObjectSelectionPanel

use of com.evolveum.midpoint.web.page.admin.configuration.component.ObjectSelectionPanel 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);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ObjectSelectionPanel(com.evolveum.midpoint.web.page.admin.configuration.component.ObjectSelectionPanel) UserOrgReferenceChoosePanel(com.evolveum.midpoint.web.page.admin.roles.component.UserOrgReferenceChoosePanel) ModalWindow(org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)

Aggregations

ObjectSelectionPanel (com.evolveum.midpoint.web.page.admin.configuration.component.ObjectSelectionPanel)1 UserOrgReferenceChoosePanel (com.evolveum.midpoint.web.page.admin.roles.component.UserOrgReferenceChoosePanel)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 ModalWindow (org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)1