コード例 #1
0
    @Override
    public void execute(Event<UISpaceSearch> event) throws Exception {
      WebuiRequestContext ctx = event.getRequestContext();
      UISpaceSearch uiSpaceSearch = event.getSource();
      String charSearch = ctx.getRequestParameter(OBJECTID);
      ResourceBundle resApp = ctx.getApplicationResourceBundle();
      String defaultSpaceNameAndDesc =
          resApp.getString(uiSpaceSearch.getId() + ".label.DefaultSpaceNameAndDesc");
      String searchCondition =
          (((UIFormStringInput) uiSpaceSearch.getChildById(SPACE_SEARCH)).getValue());
      if ((searchCondition == null || searchCondition.equals(defaultSpaceNameAndDesc))
          && charSearch == null) {
        uiSpaceSearch.setSelectedChar(null);
        uiSpaceSearch.setSpaceNameSearch(null);
        ctx.addUIComponentToUpdateByAjax(uiSpaceSearch);
      } else {
        if (searchCondition != null) {
          searchCondition = searchCondition.trim();
        }
        if (charSearch != null) {
          ((UIFormStringInput) uiSpaceSearch.getChildById(SPACE_SEARCH))
              .setValue(defaultSpaceNameAndDesc);
        }
        uiSpaceSearch.setSelectedChar(charSearch);
        uiSpaceSearch.setSpaceNameSearch(searchCondition);
        uiSpaceSearch.setNewSearch(true);

        Event<UIComponent> searchEvent =
            uiSpaceSearch.<UIComponent>getParent().createEvent(SEARCH, Event.Phase.DECODE, ctx);
        if (searchEvent != null) {
          searchEvent.broadcast();
        }
      }
    }
コード例 #2
0
 @Override
 public void execute(Event<UISpaceSearch> event) throws Exception {
   UISpaceSearch uiSpaceSearch = event.getSource();
   UIPopupWindow uiPopup = uiSpaceSearch.getChild(UIPopupWindow.class);
   UISpaceAddForm uiAddSpaceForm =
       uiSpaceSearch.createUIComponent(UISpaceAddForm.class, null, null);
   uiPopup.setUIComponent(uiAddSpaceForm);
   uiPopup.setWindowSize(500, 0);
   uiPopup.setShow(true);
 }