예제 #1
0
    public void execute(Event<UIUserSelector> event) throws Exception {
      UIUserSelector uiSelectUserForm = event.getSource();
      uiSelectUserForm.setSelectedItem();

      int page = Integer.parseInt(event.getRequestContext().getRequestParameter(OBJECTID));
      uiSelectUserForm.updateCurrentPage(page);
      event.getRequestContext().addUIComponentToUpdateByAjax(uiSelectUserForm);
    }
예제 #2
0
    public void execute(Event<UIUserSelector> event) throws Exception {
      UIUserSelector uiForm = event.getSource();

      String keyword = uiForm.getUIStringInput(FIELD_KEYWORD).getValue();
      String filter = uiForm.getUIFormSelectBox(FIELD_FILTER).getValue();
      String groupId = uiForm.getSelectedGroup();
      uiForm.search(keyword, filter, groupId);
      if (filter == null || filter.trim().length() == 0) return;

      event.getRequestContext().addUIComponentToUpdateByAjax(uiForm);
    }
예제 #3
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);
 }
예제 #4
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);
    }
예제 #5
0
    public void execute(Event<UIUserSelector> event) throws Exception {
      UIUserSelector uiForm = event.getSource();
      StringBuilder sb = new StringBuilder();

      uiForm.setSelectedItem();

      // get item from selected item map
      Set<String> items = uiForm.uiIterator_.getSelectedItems();
      if (items.size() == 0) {
        UIApplication uiApp = uiForm.getAncestorOfType(UIApplication.class);
        uiApp.addMessage(new ApplicationMessage("UIUserSelector.msg.user-required", null));
        return;
      }
      String[] arrItems = items.toArray(new String[items.size()]);
      Arrays.sort(arrItems);

      for (String key : arrItems) {
        if (sb.toString() != null && sb.toString().trim().length() != 0) sb.append(",");
        sb.append(key);
      }

      uiForm.setSelectedUsers(sb.toString());
      uiForm.<UIComponent>getParent().broadcast(event, event.getExecutionPhase());
    }
예제 #6
0
 public void execute(Event<UIUserSelector> event) throws Exception {
   UIUserSelector uiForm = event.getSource();
   uiForm.getChild(UIPopupWindow.class).setShow(true);
 }
예제 #7
0
 public void execute(Event<UIUserSelector> event) throws Exception {
   UIUserSelector uiForm = event.getSource();
   uiForm.<UIComponent>getParent().broadcast(event, event.getExecutionPhase());
 }
예제 #8
0
 public void execute(Event<UIUserSelector> event) throws Exception {
   UIUserSelector uiForm = event.getSource();
   String userName = event.getRequestContext().getRequestParameter(OBJECTID);
   uiForm.setSelectedUsers(userName);
   uiForm.<UIComponent>getParent().broadcast(event, event.getExecutionPhase());
 }