Ejemplo n.º 1
0
 public void execute(Event<UIGroupSelector> event) throws Exception {
   UIGroupSelector uiSelectGroupForm = event.getSource();
   UIUserSelector uiSelectUserForm = uiSelectGroupForm.<UIComponent>getParent().getParent();
   String groupId = event.getRequestContext().getRequestParameter(OBJECTID);
   uiSelectUserForm.setSelectedGroup(groupId);
   OrganizationService service =
       uiSelectGroupForm.getApplicationComponent(OrganizationService.class);
   PageList users =
       uiSelectUserForm.removeDuplicate(service.getUserHandler().findUsersByGroup(groupId));
   users.setPageSize(10);
   uiSelectUserForm.uiIterator_.setPageList(users);
   uiSelectUserForm.setKeyword(null);
   event.getRequestContext().addUIComponentToUpdateByAjax(uiSelectUserForm);
 }
Ejemplo n.º 2
0
    public void execute(Event<UIUserSelector> event) throws Exception {
      UIUserSelector uiSelectUserForm = event.getSource();
      String groupId = uiSelectUserForm.getSelectedGroup();
      OrganizationService service =
          uiSelectUserForm.getApplicationComponent(OrganizationService.class);

      PageList users = PageList.EMPTY_LIST;
      if (groupId != null && groupId.trim().length() != 0) {
        if (service.getGroupHandler().findGroupById(groupId) != null) {
          users =
              uiSelectUserForm.removeDuplicate(service.getUserHandler().findUsersByGroup(groupId));
        }
      } else {
        users = service.getUserHandler().findUsers(new Query());
      }
      users.setPageSize(10);
      uiSelectUserForm.uiIterator_.setPageList(users);
      uiSelectUserForm.setKeyword(null);
      event.getRequestContext().addUIComponentToUpdateByAjax(uiSelectUserForm);
    }