public void execute(Event<UISelectUserForm> event) throws Exception { UISelectUserForm uiAddressForm = event.getSource(); UIPopupContainer uiContainer = uiAddressForm.getAncestorOfType(UIPopupContainer.class); UIPopupAction chilPopup = uiContainer.getChild(UIPopupAction.class); chilPopup.deActivate(); event.getRequestContext().addUIComponentToUpdateByAjax(chilPopup); }
public void execute(Event<UISelectUserForm> event) throws Exception { UISelectUserForm uiForm = event.getSource(); UIPopupContainer uiContainer = uiForm.getAncestorOfType(UIPopupContainer.class); UIEventForm uiEventForm = uiContainer.findFirstComponentOfType(UIEventForm.class); if (uiEventForm != null) { StringBuilder sb = new StringBuilder(); for (Object o : uiForm.uiIterator_.getCurrentPageData()) { User u = (User) o; UIFormCheckBoxInput input = uiForm.getUIFormCheckBoxInput(u.getUserName()); if (input != null && input.isChecked()) { if (sb != null && sb.length() > 0) sb.append(CalendarUtils.COMMA); sb.append(u.getUserName()); } } if (CalendarUtils.isEmpty(sb.toString())) { event .getRequestContext() .getUIApplication() .addMessage(new ApplicationMessage("UISelectUserForm.msg.user-required", null)); return; } uiEventForm.setSelectedTab(uiForm.tabId_); event.getRequestContext().addUIComponentToUpdateByAjax(uiEventForm.getParent()); } UIPopupAction chilPopup = uiContainer.getChild(UIPopupAction.class); chilPopup.deActivate(); event.getRequestContext().addUIComponentToUpdateByAjax(chilPopup); }