Пример #1
0
 public void execute(Event<UIGroupMemberSelector> event) throws Exception {
   UIGroupMemberSelector uiGroupMemberSelector = event.getSource();
   if (uiGroupMemberSelector.getCurrentGroup() == null) return;
   String groupId = uiGroupMemberSelector.getCurrentGroup().getId();
   String permission = event.getRequestContext().getRequestParameter(OBJECTID);
   String value = "";
   if (uiGroupMemberSelector.isSelectedUser()) {
     value = permission;
   } else {
     value = permission + ":" + groupId;
   }
   String returnField = uiGroupMemberSelector.getReturnField();
   ((UISelectable) uiGroupMemberSelector.getSourceComponent()).doSelect(returnField, value);
   if (uiGroupMemberSelector.isUsePopup) {
     UIPopupWindow uiPopup = uiGroupMemberSelector.getParent();
     uiPopup.setShow(false);
     UIComponent uicomp = uiGroupMemberSelector.getSourceComponent().getParent();
     event.getRequestContext().addUIComponentToUpdateByAjax(uicomp);
     if (!uiPopup.getId().equals("PopupComponent"))
       event.getRequestContext().addUIComponentToUpdateByAjax(uiPopup);
   } else {
     event
         .getRequestContext()
         .addUIComponentToUpdateByAjax(uiGroupMemberSelector.getSourceComponent());
   }
 }
Пример #2
0
 public void execute(Event<UIAnyPermission> event) throws Exception {
   UIAnyPermission uiAnyPermission = event.getSource();
   UIGroupMemberSelector uiGroupMemberSelector = uiAnyPermission.getParent();
   String returnField = uiGroupMemberSelector.getReturnField();
   String value = IdentityConstants.ANY;
   ((UISelectable) uiGroupMemberSelector.getSourceComponent()).doSelect(returnField, value);
   if (uiGroupMemberSelector.isUsePopup()) {
     UIPopupWindow uiPopup = uiGroupMemberSelector.getParent();
     uiPopup.setShow(false);
     UIComponent uicomp = uiGroupMemberSelector.getSourceComponent().getParent();
     event.getRequestContext().addUIComponentToUpdateByAjax(uicomp);
     if (!uiPopup.getId().equals("PopupComponent"))
       event.getRequestContext().addUIComponentToUpdateByAjax(uiPopup);
   } else {
     event
         .getRequestContext()
         .addUIComponentToUpdateByAjax(uiGroupMemberSelector.getSourceComponent());
   }
 }