Exemple #1
0
 public void onEvent(Event<UICategoryForm> event, UICategoryForm categoryForm, String objectId)
     throws Exception {
   ;
   String[] objects = objectId.split(ForumUtils.COMMA);
   String type = objects[0];
   String param = objects[1];
   UIPopupContainer popupContainer = categoryForm.getAncestorOfType(UIPopupContainer.class);
   UIUserSelect uiUserSelect = popupContainer.findFirstComponentOfType(UIUserSelect.class);
   if (uiUserSelect != null) {
     UIPopupWindow popupWindow = uiUserSelect.getParent();
     closePopupWindow(popupWindow);
   }
   UIGroupSelector uiGroupSelector = null;
   if (type.equals(UIGroupSelector.TYPE_MEMBERSHIP)) {
     uiGroupSelector =
         openPopup(popupContainer, UIGroupSelector.class, "UIMemberShipSelector", 600, 0);
   } else if (type.equals(UIGroupSelector.TYPE_GROUP)) {
     uiGroupSelector = openPopup(popupContainer, UIGroupSelector.class, "GroupSelector", 600, 0);
   }
   uiGroupSelector.getAncestorOfType(UIPopupWindow.class).setRendered(true);
   uiGroupSelector.setType(type);
   uiGroupSelector.setSpaceGroupId(
       categoryForm.getAncestorOfType(UIForumPortlet.class).getSpaceGroupId());
   uiGroupSelector.setComponent(categoryForm, new String[] {param});
   uiGroupSelector.getChild(UITree.class).setId(UIGroupSelector.TREE_GROUP_ID);
   uiGroupSelector
       .getChild(org.exoplatform.webui.core.UIBreadcumbs.class)
       .setId(UIGroupSelector.BREADCUMB_GROUP_ID);
 }
Exemple #2
0
 public void execute(Event<UIUserSelect> event) throws Exception {
   UIUserSelect uiUserSelector = event.getSource();
   String values = uiUserSelector.getSelectedUsers();
   UIForumPortlet forumPortlet = uiUserSelector.getAncestorOfType(UIForumPortlet.class);
   UICategoryForm categoryForm = forumPortlet.findFirstComponentOfType(UICategoryForm.class);
   UIPopupWindow popupWindow = uiUserSelector.getParent();
   String id = uiUserSelector.getPermisionType();
   if (id.equals(FIELD_USERPRIVATE_MULTIVALUE)) {
     UIFormInputWithActions catDetail = categoryForm.getChildById(CATEGORY_DETAIL_TAB);
     categoryForm.setValueField(catDetail, FIELD_USERPRIVATE_MULTIVALUE, values);
   }
   closePopupWindow(popupWindow);
   event.getRequestContext().addUIComponentToUpdateByAjax(categoryForm);
 }