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); }
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()); }