private static void renderHandler(FacesContext context,UIComponent component,Collection<ClientBehaviorContext.Parameter> params,String handlerName,Object handlerValue,String behaviorEventName,String submitTarget,boolean needsSubmit,boolean includeExec) throws IOException {
  ResponseWriter writer=context.getResponseWriter();
  String userHandler=getNonEmptyUserHandler(handlerValue);
  List<ClientBehavior> behaviors=getClientBehaviors(component,behaviorEventName);
  if ((null != behaviors) && (behaviors.size() > 0) && Util.componentIsDisabled(component)) {
    behaviors=null;
  }
  if (params == null) {
    params=Collections.emptyList();
  }
  String handler=null;
switch (getHandlerType(behaviors,params,userHandler,needsSubmit,includeExec)) {
case USER_HANDLER_ONLY:
    handler=userHandler;
  break;
case SINGLE_BEHAVIOR_ONLY:
handler=getSingleBehaviorHandler(context,component,behaviors.get(0),params,behaviorEventName,submitTarget,needsSubmit);
break;
case SUBMIT_ONLY:
handler=getSubmitHandler(context,component,params,submitTarget,true);
break;
case CHAIN:
handler=getChainedHandler(context,component,behaviors,params,behaviorEventName,userHandler,submitTarget,needsSubmit);
break;
default :
assert (false);
}
writer.writeAttribute(handlerName,handler,null);
}

private static void renderHandler ( FacesContext context , UIComponent component , Collection < ClientBehaviorContext . Parameter > params , String handlerName , Object handlerValue , String behaviorEventName , String submitTarget , boolean needsSubmit , boolean includeExec ) throws IOException { ResponseWriter writer = context . getResponseWriter ( ) ; String userHandler = getNonEmptyUserHandler ( handlerValue ) ; List < ClientBehavior > behaviors = getClientBehaviors ( component , behaviorEventName ) ; if ( ( null != behaviors ) && ( behaviors . size ( ) > 0 ) && Util . componentIsDisabled ( component ) ) { behaviors = null ; } if ( params == null ) { params = Collections . emptyList ( ) ; } String handler = null ; switch ( getHandlerType ( behaviors , params , userHandler , needsSubmit , includeExec ) ) { case USER_HANDLER_ONLY : handler = userHandler ; break ; case SINGLE_BEHAVIOR_ONLY : handler = getSingleBehaviorHandler ( context , component , behaviors . get ( 0 ) , params , behaviorEventName , submitTarget , needsSubmit ) ; break ; case SUBMIT_ONLY : handler = getSubmitHandler ( context , component , params , submitTarget , true ) ; break ; case CHAIN : handler = getChainedHandler ( context , component , behaviors , params , behaviorEventName , userHandler , submitTarget , needsSubmit ) ; break ; default : assert ( false ) ; } writer . writeAttribute ( handlerName , handler , null ) ; }
renders a handler script , which may require chaining together the user - specified event handler , any scripts required by attached behaviors , and also possibly the mojarra . jsfcljs ( ) " submit " script .
