Example usage for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow getContentId

List of usage examples for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow getContentId

Introduction

In this page you can find the example usage for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow getContentId.

Prototype

public String getContentId() 

Source Link

Document

Returns the id of content component.

Usage

From source file:org.apache.directory.fortress.web.panel.RoleAdminDetailPanel.java

License:Apache License

private void addUserOUSearchModal() {
    final ModalWindow userousModalWindow;
    add(userousModalWindow = new ModalWindow("useroumodal"));
    final OUSearchModalPanel userouSearchModalPanel = new OUSearchModalPanel(userousModalWindow.getContentId(),
            userousModalWindow, true);/*from   w w w.j a  va  2  s .com*/
    userousModalWindow.setContent(userouSearchModalPanel);
    userousModalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(AjaxRequestTarget target) {
            OrgUnit ou = userouSearchModalPanel.getSelection();
            if (ou != null) {
                userouSelection = ou.getName();
                AdminRole adminRole = (AdminRole) getDefaultModelObject();
                adminRole.setOsU(userouSelection);
                target.add(userouCB);
            }
        }
    });

    add(new AjaxButton(GlobalIds.USEROU_SEARCH) {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            String msg = "clicked on user OU search";
            msg += userouSelection != null ? ": " + userouSelection : "";
            userouSearchModalPanel.setSearchVal(userouSelection);
            LOG.debug(msg);
            target.prependJavaScript(GlobalIds.WICKET_WINDOW_UNLOAD_CONFIRMATION_FALSE);
            userousModalWindow.show(target);
        }

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            AjaxCallListener ajaxCallListener = new AjaxCallListener() {
                /** Default serialVersionUID */
                private static final long serialVersionUID = 1L;

                @Override
                public CharSequence getFailureHandler(Component component) {
                    return GlobalIds.WINDOW_LOCATION_REPLACE_COMMANDER_HOME_HTML;
                }
            };
            attributes.getAjaxCallListeners().add(ajaxCallListener);
        }
    });

    userousModalWindow.setTitle("User Organization Selection Modal");
    userousModalWindow.setInitialWidth(450);
    userousModalWindow.setInitialHeight(450);
    userousModalWindow.setCookieName("permou-modal");

    add(new AjaxButton("userou.delete") {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            String msg = "clicked on userous.delete";
            if (StringUtils.isNotEmpty(userouSelection)) {
                msg += " selection:" + userouSelection;
                AdminRole adminRole = (AdminRole) form.getModel().getObject();
                if (adminRole.getOsUSet() != null) {
                    adminRole.getOsUSet().remove(userouSelection);
                    userous.remove(userouSelection);
                    userouSelection = "";
                    target.add(userouCB);
                    msg += ", was removed from local, commit to persist changes on server";
                } else {
                    msg += ", no action taken because org unit does not have parent set";
                }
            } else {
                msg += ", no action taken because parents selection is empty";
            }
            LOG.debug(msg);
        }

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            AjaxCallListener ajaxCallListener = new AjaxCallListener() {
                /** Default serialVersionUID */
                private static final long serialVersionUID = 1L;

                @Override
                public CharSequence getFailureHandler(Component component) {
                    return GlobalIds.WINDOW_LOCATION_REPLACE_COMMANDER_HOME_HTML;
                }
            };
            attributes.getAjaxCallListeners().add(ajaxCallListener);
        }
    });
}

From source file:org.apache.directory.fortress.web.panel.RoleAdminDetailPanel.java

License:Apache License

private void addBeginRoleSearchModal() {
    final ModalWindow beginRoleModalWindow;
    add(beginRoleModalWindow = new ModalWindow("beginrolesmodal"));
    final RoleSearchModalPanel beginRoleSearchModalPanel = new RoleSearchModalPanel(
            beginRoleModalWindow.getContentId(), beginRoleModalWindow, false);
    beginRoleModalWindow.setContent(beginRoleSearchModalPanel);
    beginRoleModalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override/* ww  w  . jav  a 2 s .  co  m*/
        public void onClose(AjaxRequestTarget target) {
            UserRole userRole = beginRoleSearchModalPanel.getRoleSelection();
            if (userRole != null) {
                AdminRole adminRole = (AdminRole) getDefaultModelObject();
                adminRole.setBeginRange(userRole.getName());
                target.add(beginRangeTF);
            }
        }
    });

    add(new AjaxButton(GlobalIds.BEGIN_RANGE_SEARCH) {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            AdminRole adminRole = (AdminRole) form.getModel().getObject();
            beginRoleSearchModalPanel.setRoleSearchVal(adminRole.getBeginRange());
            target.prependJavaScript(GlobalIds.WICKET_WINDOW_UNLOAD_CONFIRMATION_FALSE);
            beginRoleModalWindow.show(target);
        }

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            AjaxCallListener ajaxCallListener = new AjaxCallListener() {
                /** Default serialVersionUID */
                private static final long serialVersionUID = 1L;

                @Override
                public CharSequence getFailureHandler(Component component) {
                    return GlobalIds.WINDOW_LOCATION_REPLACE_COMMANDER_HOME_HTML;
                }
            };
            attributes.getAjaxCallListeners().add(ajaxCallListener);
        }
    });

    beginRoleModalWindow.setTitle("Begin Range Role Selection Modal");
    beginRoleModalWindow.setInitialWidth(700);
    beginRoleModalWindow.setInitialHeight(450);
    beginRoleModalWindow.setCookieName(ROLE_ASSIGN_MODAL);
}

From source file:org.apache.directory.fortress.web.panel.RoleAdminDetailPanel.java

License:Apache License

private void addEndRoleSearchModal() {
    final ModalWindow endRoleModalWindow;
    add(endRoleModalWindow = new ModalWindow("endrolesmodal"));
    final RoleSearchModalPanel endRoleSearchModalPanel = new RoleSearchModalPanel(
            endRoleModalWindow.getContentId(), endRoleModalWindow, false);
    endRoleModalWindow.setContent(endRoleSearchModalPanel);
    endRoleModalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override/*ww w. j  a  v  a2  s  . co m*/
        public void onClose(AjaxRequestTarget target) {
            UserRole userRole = endRoleSearchModalPanel.getRoleSelection();
            if (userRole != null) {
                AdminRole adminRole = (AdminRole) getDefaultModelObject();
                adminRole.setEndRange(userRole.getName());
                target.add(endRangeTF);
            }
        }
    });

    add(new AjaxButton(GlobalIds.END_RANGE_SEARCH) {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            AdminRole adminRole = (AdminRole) form.getModel().getObject();
            endRoleSearchModalPanel.setRoleSearchVal(adminRole.getBeginRange());
            endRoleSearchModalPanel.setParentSearch(true);
            target.prependJavaScript(GlobalIds.WICKET_WINDOW_UNLOAD_CONFIRMATION_FALSE);
            endRoleModalWindow.show(target);
        }

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            AjaxCallListener ajaxCallListener = new AjaxCallListener() {
                /** Default serialVersionUID */
                private static final long serialVersionUID = 1L;

                @Override
                public CharSequence getFailureHandler(Component component) {
                    return GlobalIds.WINDOW_LOCATION_REPLACE_COMMANDER_HOME_HTML;
                }
            };
            attributes.getAjaxCallListeners().add(ajaxCallListener);
        }
    });

    endRoleModalWindow.setTitle("End Range Role Selection Modal");
    endRoleModalWindow.setInitialWidth(700);
    endRoleModalWindow.setInitialHeight(450);
    endRoleModalWindow.setCookieName(ROLE_ASSIGN_MODAL);
}

From source file:org.apache.directory.fortress.web.panel.SDListPanel.java

License:Apache License

private void addRoleSearchModal(Radio roleRb) {
    final ModalWindow rolesModalWindow;
    listForm.add(rolesModalWindow = new ModalWindow("rolesearchmodal"));
    final RoleSearchModalPanel roleSearchModalPanel = new RoleSearchModalPanel(rolesModalWindow.getContentId(),
            rolesModalWindow, false);//  w ww  . j  a  v  a  2 s.  co  m
    rolesModalWindow.setContent(roleSearchModalPanel);
    rolesModalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(AjaxRequestTarget target) {
            UserRole roleConstraint = roleSearchModalPanel.getRoleSelection();
            if (roleConstraint != null) {
                log.debug("modal selected:" + roleConstraint.getName());
                searchVal = roleConstraint.getName();
                selectedRadioButton = ROLES;
                target.add(radioGroup);
            }
        }
    });

    roleRb.add(new SecureIndicatingAjaxLink("roleAssignLinkLbl", GlobalIds.REVIEW_MGR, "findRoles") {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        public void onClick(AjaxRequestTarget target) {
            String msg = "clicked on roles search";
            msg += "roleSelection: " + searchVal;
            roleSearchModalPanel.setRoleSearchVal(searchVal);
            log.debug(msg);
            target.prependJavaScript(GlobalIds.WICKET_WINDOW_UNLOAD_CONFIRMATION_FALSE);
            rolesModalWindow.show(target);
        }

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            AjaxCallListener ajaxCallListener = new AjaxCallListener() {
                /** Default serialVersionUID */
                private static final long serialVersionUID = 1L;

                @Override
                public CharSequence getFailureHandler(Component component) {
                    return GlobalIds.WINDOW_LOCATION_REPLACE_COMMANDER_HOME_HTML;
                }
            };
            attributes.getAjaxCallListeners().add(ajaxCallListener);
        }
    });

    rolesModalWindow.setTitle("Role Search Modal");
    rolesModalWindow.setInitialWidth(700);
    rolesModalWindow.setInitialHeight(450);
    rolesModalWindow.setCookieName("role-assign-modal");
}

From source file:org.apache.directory.fortress.web.panel.UserListPanel.java

License:Apache License

private void addRoleSearchModal(Radio roleRb) {
    final ModalWindow rolesModalWindow;
    userformsearchfields.add(rolesModalWindow = new ModalWindow("rolesearchmodal"));
    final RoleSearchModalPanel roleSearchModalPanel = new RoleSearchModalPanel(rolesModalWindow.getContentId(),
            rolesModalWindow, false);/*from  w w w. j  av  a2 s .  co  m*/
    rolesModalWindow.setContent(roleSearchModalPanel);
    rolesModalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(AjaxRequestTarget target) {
            UserRole roleConstraint = roleSearchModalPanel.getRoleSelection();
            if (roleConstraint != null) {
                LOG.debug("modal selected:" + roleConstraint.getName());
                searchData.setField1(roleConstraint.getName());
                selectedRadioButton = ROLES;
                enableRoleSearch();
                target.add(searchFields);
                target.add(radioGroup);
            }
        }
    });

    roleRb.add(new SecureIndicatingAjaxLink("roleAssignLinkLbl", GlobalIds.REVIEW_MGR, GlobalIds.FIND_ROLES) {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        public void onClick(AjaxRequestTarget target) {
            roleSearchModalPanel.setRoleSearchVal(searchData.getField1());
            roleSearchModalPanel.setAdmin(false);
            target.prependJavaScript(GlobalIds.WICKET_WINDOW_UNLOAD_CONFIRMATION_FALSE);
            rolesModalWindow.show(target);
        }

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            AjaxCallListener ajaxCallListener = new AjaxCallListener() {
                /** Default serialVersionUID */
                private static final long serialVersionUID = 1L;

                @Override
                public CharSequence getFailureHandler(Component component) {
                    return GlobalIds.WINDOW_LOCATION_REPLACE_COMMANDER_HOME_HTML;
                }
            };
            attributes.getAjaxCallListeners().add(ajaxCallListener);
        }
    });
    rolesModalWindow.setTitle("RBAC Role Search Modal");
    rolesModalWindow.setInitialWidth(700);
    rolesModalWindow.setInitialHeight(450);
    rolesModalWindow.setCookieName("role-assign-modal");
}

From source file:org.apache.directory.fortress.web.panel.UserListPanel.java

License:Apache License

private void addAdminRoleSearchModal(Radio adminRoleRb) {
    final ModalWindow adminRolesModalWindow;
    userformsearchfields.add(adminRolesModalWindow = new ModalWindow("adminrolesearchmodal"));
    final RoleSearchModalPanel adminRoleSearchModalPanel = new RoleSearchModalPanel(
            adminRolesModalWindow.getContentId(), adminRolesModalWindow, true);
    adminRolesModalWindow.setContent(adminRoleSearchModalPanel);
    adminRolesModalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override// w  w w .j ava 2s . co m
        public void onClose(AjaxRequestTarget target) {
            UserRole roleConstraint = adminRoleSearchModalPanel.getRoleSelection();
            if (roleConstraint != null) {
                searchData.setField1(roleConstraint.getName());
                selectedRadioButton = ADMIN_ROLES;
                enableAdminSearch();
                target.add(searchFields);
                target.add(radioGroup);
            }
        }
    });

    adminRoleRb.add(new SecureIndicatingAjaxLink("adminRoleAssignLinkLbl", GlobalIds.DEL_REVIEW_MGR,
            GlobalIds.FIND_ROLES) {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        public void onClick(AjaxRequestTarget target) {
            String msg = "clicked on admin roles search";
            msg += "adminRoleSelection: " + searchData.getField1();
            adminRoleSearchModalPanel.setRoleSearchVal(searchData.getField1());
            adminRoleSearchModalPanel.setAdmin(true);
            LOG.debug(msg);
            target.prependJavaScript(GlobalIds.WICKET_WINDOW_UNLOAD_CONFIRMATION_FALSE);
            adminRolesModalWindow.show(target);
        }

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            AjaxCallListener ajaxCallListener = new AjaxCallListener() {
                /** Default serialVersionUID */
                private static final long serialVersionUID = 1L;

                @Override
                public CharSequence getFailureHandler(Component component) {
                    return GlobalIds.WINDOW_LOCATION_REPLACE_COMMANDER_HOME_HTML;
                }
            };
            attributes.getAjaxCallListeners().add(ajaxCallListener);
        }
    });
    adminRolesModalWindow.setTitle("Admin Role Search Modal");
    adminRolesModalWindow.setInitialWidth(700);
    adminRolesModalWindow.setInitialHeight(450);
    adminRolesModalWindow.setCookieName("role-assign-modal");
}

From source file:org.apache.directory.fortress.web.panel.UserListPanel.java

License:Apache License

private void addOUSearchModal(Radio ouRb) {
    final ModalWindow ousModalWindow;
    userformsearchfields.add(ousModalWindow = new ModalWindow("ousearchmodal"));
    final OUSearchModalPanel ouSearchModalPanel = new OUSearchModalPanel(ousModalWindow.getContentId(),
            ousModalWindow, true);/*from w  ww  .  j  a va2 s  .c om*/
    ousModalWindow.setContent(ouSearchModalPanel);
    ousModalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(AjaxRequestTarget target) {
            OrgUnit ou = ouSearchModalPanel.getSelection();
            if (ou != null) {
                searchData.setField1(ou.getName());
            }
            selectedRadioButton = OUS;
            enableOuSearch();
            target.add(searchFields);
            target.add(radioGroup);
        }
    });
    ouRb.add(new SecureIndicatingAjaxLink("ouAssignLinkLbl", GlobalIds.DEL_REVIEW_MGR, "searchOU") {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        public void onClick(AjaxRequestTarget target) {
            ouSearchModalPanel.setSearchVal(searchData.getField1());
            target.prependJavaScript(GlobalIds.WICKET_WINDOW_UNLOAD_CONFIRMATION_FALSE);
            ousModalWindow.show(target);
        }

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            AjaxCallListener ajaxCallListener = new AjaxCallListener() {
                /** Default serialVersionUID */
                private static final long serialVersionUID = 1L;

                @Override
                public CharSequence getFailureHandler(Component component) {
                    return GlobalIds.WINDOW_LOCATION_REPLACE_COMMANDER_HOME_HTML;
                }
            };
            attributes.getAjaxCallListeners().add(ajaxCallListener);
        }
    });

    ousModalWindow.setTitle("User Organizational Unit Search Modal");
    ousModalWindow.setInitialWidth(450);
    ousModalWindow.setInitialHeight(450);
    ousModalWindow.setCookieName("userou-modal");
}

From source file:org.apache.directory.fortress.web.panel.UserListPanel.java

License:Apache License

private void addPermSearchModal(Radio permRb) {
    final ModalWindow permsModalWindow;
    userformsearchfields.add(permsModalWindow = new ModalWindow("permsearchmodal"));
    final PermSearchModalPanel permSearchModalPanel = new PermSearchModalPanel(permsModalWindow.getContentId(),
            permsModalWindow, false);/*from  w w  w  . j  av a 2 s . c o m*/
    permsModalWindow.setContent(permSearchModalPanel);
    permsModalWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        @Override
        public void onClose(AjaxRequestTarget target) {
            Permission permSelection = permSearchModalPanel.getSelection();
            if (permSelection != null) {
                searchData.setField1(permSelection.getObjName());
                searchData.setField2(permSelection.getOpName());
            }
            selectedRadioButton = PERMS;
            enablePermSearch();
            target.add(searchFields);
            target.add(radioGroup);
        }
    });
    permRb.add(new SecureIndicatingAjaxLink("permLinkLbl", GlobalIds.REVIEW_MGR, GlobalIds.FIND_PERMISSIONS) {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;

        public void onClick(AjaxRequestTarget target) {
            String msg = "clicked on perms search";
            msg += "permSelection: " + permission;
            String objectSearchVal = "";
            if (StringUtils.isNotEmpty(searchData.getField1())) {
                objectSearchVal = searchData.getField1();
            }
            permSearchModalPanel.setSearchVal(objectSearchVal);
            LOG.debug(msg);
            target.prependJavaScript(GlobalIds.WICKET_WINDOW_UNLOAD_CONFIRMATION_FALSE);
            permsModalWindow.show(target);
        }

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);
            AjaxCallListener ajaxCallListener = new AjaxCallListener() {
                /** Default serialVersionUID */
                private static final long serialVersionUID = 1L;

                @Override
                public CharSequence getFailureHandler(Component component) {
                    return GlobalIds.WINDOW_LOCATION_REPLACE_COMMANDER_HOME_HTML;
                }
            };
            attributes.getAjaxCallListeners().add(ajaxCallListener);
        }
    });
    permsModalWindow.setTitle("Permission Search Modal");
    permsModalWindow.setInitialWidth(650);
    permsModalWindow.setInitialHeight(450);
    permsModalWindow.setCookieName("perm-search-modal");
}

From source file:org.apache.jetspeed.portlets.rpad.RPADEditor.java

License:Apache License

public RPADEditor() {
    final PortletDeployer deployer = new JetspeedPortletDeployer();
    IModel getRepo = new LoadableDetachableModel() {

        protected Object load() {
            return getRepo();
        }//from w ww . ja  va 2s  .  c  o  m
    };
    final WebMarkupContainer tableGroup = new WebMarkupContainer("tableGroup");
    final ModalWindow metaDataModalWindow = new ModalWindow("modalwindow");
    final PageableListView listview = new PageableListView("repositories", getRepo, 10) {
        @Override
        protected void populateItem(final ListItem item) {
            final Repository repo = (Repository) item.getModelObject();
            item.add(new Label("name", repo.getName()));
            item.add(new Label("url", repo.getConfigPath()));
            item.add(new AjaxLink("edit", item.getModel()) {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    metaDataModalWindow.setContent(
                            new RepositoryPanel(metaDataModalWindow.getContentId(), repo, tableGroup));
                    metaDataModalWindow.show(target);
                }
            });
            item.add(new AjaxLink("remove", item.getModel()) {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    try {
                        getPortletRequest().getPreferences().reset(repo.getName());
                        getRepositoryManager()
                                .reload(RemotePortletAppDeployer.getReposList(getPortletRequest()));
                        target.addComponent(tableGroup);
                    } catch (ReadOnlyException e) {
                        logger.error("The preference is read-only: {}", repo.getName());
                    }
                }
            });
        }
    };
    listview.setOutputMarkupId(true);

    tableGroup.setOutputMarkupId(true);
    tableGroup.add(new PagingNavigator("navigator", listview));
    tableGroup.add(listview);
    add(metaDataModalWindow);
    add(tableGroup);
    add(new AjaxLink("newRepo") {

        @Override
        public void onClick(AjaxRequestTarget target) {
            metaDataModalWindow.setContent(new RepositoryPanel(metaDataModalWindow.getContentId(),
                    new SimpleRepository("", ""), tableGroup));
            metaDataModalWindow.show(target);
        }
    });
}

From source file:org.apache.syncope.client.console.pages.ResultStatusModalPage.java

License:Apache License

private ResultStatusModalPage(final Builder builder) {
    super();//from   w  ww  . ja  va 2s  .  com
    this.subject = builder.subject;
    statusUtils = new StatusUtils(this.userRestClient);
    if (builder.mode == null) {
        this.mode = Mode.ADMIN;
    } else {
        this.mode = builder.mode;
    }

    final BaseModalPage page = this;

    final WebMarkupContainer container = new WebMarkupContainer("container");
    container.setOutputMarkupId(true);
    add(container);

    final Fragment fragment = new Fragment("resultFrag",
            mode == Mode.SELF ? "userSelfResultFrag" : "propagationResultFrag", this);
    fragment.setOutputMarkupId(true);
    container.add(fragment);

    if (mode == Mode.ADMIN) {
        // add Syncope propagation status
        PropagationStatus syncope = new PropagationStatus();
        syncope.setResource("Syncope");
        syncope.setStatus(PropagationTaskExecStatus.SUCCESS);

        List<PropagationStatus> propagations = new ArrayList<PropagationStatus>();
        propagations.add(syncope);
        propagations.addAll(subject.getPropagationStatusTOs());

        fragment.add(new Label("info",
                ((subject instanceof UserTO) && ((UserTO) subject).getUsername() != null)
                        ? ((UserTO) subject).getUsername()
                        : ((subject instanceof GroupTO) && ((GroupTO) subject).getName() != null)
                                ? ((GroupTO) subject).getName()
                                : String.valueOf(subject.getKey())));

        final ListView<PropagationStatus> propRes = new ListView<PropagationStatus>("resources", propagations) {

            private static final long serialVersionUID = -1020475259727720708L;

            @Override
            protected void populateItem(final ListItem<PropagationStatus> item) {
                final PropagationStatus propTO = (PropagationStatus) item.getDefaultModelObject();

                final ListView attributes = getConnObjectView(propTO);

                final Fragment attrhead;
                if (attributes.getModelObject() == null || attributes.getModelObject().isEmpty()) {
                    attrhead = new Fragment("attrhead", "emptyAttrHeadFrag", page);
                } else {
                    attrhead = new Fragment("attrhead", "attrHeadFrag", page);
                }

                item.add(attrhead);
                item.add(attributes);

                attrhead.add(new Label("resource", propTO.getResource()));

                attrhead.add(new Label("propagation",
                        propTO.getStatus() == null ? "UNDEFINED" : propTO.getStatus().toString()));

                final Image image;
                final String alt, title;
                final ModalWindow failureWindow = new ModalWindow("failureWindow");
                final AjaxLink<?> failureWindowLink = new AjaxLink<Void>("showFailureWindow") {

                    private static final long serialVersionUID = -7978723352517770644L;

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        failureWindow.show(target);
                    }
                };

                switch (propTO.getStatus()) {

                case SUCCESS:
                case SUBMITTED:
                case CREATED:
                    image = new Image("icon", new ContextRelativeResource(
                            IMG_PREFIX + Status.ACTIVE.toString() + Constants.PNG_EXT));
                    alt = "success icon";
                    title = "success";
                    failureWindow.setVisible(false);
                    failureWindowLink.setEnabled(false);
                    break;

                default:
                    image = new Image("icon", new ContextRelativeResource(
                            IMG_PREFIX + Status.SUSPENDED.toString() + Constants.PNG_EXT));
                    alt = "failure icon";
                    title = "failure";
                }

                image.add(new Behavior() {

                    private static final long serialVersionUID = 1469628524240283489L;

                    @Override
                    public void onComponentTag(final Component component, final ComponentTag tag) {
                        tag.put("alt", alt);
                        tag.put("title", title);
                    }
                });
                final FailureMessageModalPage executionFailureMessagePage;
                if (propTO.getFailureReason() == null) {
                    executionFailureMessagePage = new FailureMessageModalPage(failureWindow.getContentId(),
                            StringUtils.EMPTY);
                } else {
                    executionFailureMessagePage = new FailureMessageModalPage(failureWindow.getContentId(),
                            propTO.getFailureReason());
                }

                failureWindow.setPageCreator(new ModalWindow.PageCreator() {

                    private static final long serialVersionUID = -7834632442532690940L;

                    @Override
                    public Page createPage() {
                        return executionFailureMessagePage;
                    }
                });
                failureWindow.setCookieName("failureWindow");
                failureWindow.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
                failureWindowLink.add(image);
                attrhead.add(failureWindowLink);
                attrhead.add(failureWindow);
            }
        };
        fragment.add(propRes);
    }

    final AjaxLink<Void> close = new IndicatingAjaxLink<Void>("close") {

        private static final long serialVersionUID = -7978723352517770644L;

        @Override
        public void onClick(final AjaxRequestTarget target) {
            builder.window.close(target);
        }
    };
    container.add(close);

    setOutputMarkupId(true);
}