// Creates an AjaxBehaviorEvent for the specified component/behavior private static AjaxBehaviorEvent createEvent( FacesContext facesContext, UIComponent component, AjaxBehavior ajaxBehavior) { AjaxBehaviorEvent event = new AjaxBehaviorEvent(facesContext, component, ajaxBehavior); PhaseId phaseId = isImmediate(component, ajaxBehavior) ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.INVOKE_APPLICATION; event.setPhaseId(phaseId); return event; }