Package org.ajax4jsf.javascript

Examples of org.ajax4jsf.javascript.JSFunctionDefinition.addToBody()


            AjaxFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(facesContext, component);
            ajaxFunction.getOptions().setParameter("dragSource", dragSourceId);
            ajaxFunction.getOptions().setParameter(component.getClientId(facesContext), component.getClientId(facesContext));
            ajaxFunction.setSource(new JSReference("event", "target"));
            ajaxFunction.getOptions().setAjaxComponent(component.getClientId(facesContext));
            function.addToBody(ajaxFunction);

            AbstractDropTarget dropTarget = (AbstractDropTarget) component;
            Set<String> acceptedTypes = Sets.asSet(dropTarget.getAcceptedTypes());

            if (acceptedTypes != null) {
View Full Code Here


    return statusId;
  }

  public static JSFunctionDefinition buildAjaxOncomplete(String body) {
    JSFunctionDefinition function = new JSFunctionDefinition("request", "event", "data");
    function.addToBody(body);

    return function;
  }
 
  public static JSFunctionDefinition buildAjaxOnBeforeDomUpdate(String body) {
View Full Code Here

    return function;
  }
 
  public static JSFunctionDefinition buildAjaxOnBeforeDomUpdate(String body) {
    JSFunctionDefinition function = new JSFunctionDefinition("request", "event", "data");
    function.addToBody(body);

    return function;
  }

  /**
 
View Full Code Here

    ResponseWriter writer = context.getResponseWriter();
    Object script = component.getAttributes().get(eventName);
    if (script != null && !script.equals("")) {
      JSFunctionDefinition onEventDefinition = new JSFunctionDefinition();
      onEventDefinition.addParameter("event");
      onEventDefinition.addToBody(script);
      writer.writeText(eventName + ": "
          + onEventDefinition.toScript(), null);
    }else{
      writer.writeText(eventName + ": ''", null);
    }
View Full Code Here

   
      if (event.length() != 0) {
        JSFunctionDefinition function = new JSFunctionDefinition();
        function.addParameter("event");
        if(null!=append && append.length()>0){
          function.addToBody(event+append);
        }else{
          function.addToBody(event);
        }
      return  function;
      }
View Full Code Here

        JSFunctionDefinition function = new JSFunctionDefinition();
        function.addParameter("event");
        if(null!=append && append.length()>0){
          function.addToBody(event+append);
        }else{
          function.addToBody(event);
        }
      return  function;
      }
    }
View Full Code Here

        }
        // Replace parameter value to reference.
        parameters.put(name, reference);
      }
    }
    func.addToBody(ajaxFunction.toScript());
    func.appendScript(script);
    return script.toString();
  }
}
View Full Code Here

        options.put("pollinterval", interval);
        options.put("pollId", component.getClientId(context));
        Object onsubmit = component.getAttributes().get("onsubmit");
        if (null != onsubmit) {
          JSFunctionDefinition onsubmitFunction = new JSFunctionDefinition();
          onsubmitFunction.addToBody(onsubmit);
          options.put("onsubmit", onsubmitFunction);
        }

//        options.put("timeout", interval);
        function.addParameter(options);
View Full Code Here

        buffer.append("; return false;");

  String onPageChange = (String) component.getAttributes().get("onpagechange");
  if (onPageChange != null && onPageChange.length() != 0) {
      JSFunctionDefinition onPageChangeDef = new JSFunctionDefinition("event");
      onPageChangeDef.addToBody(onPageChange);
      onPageChangeDef.addToBody("; return true;");

      definition.addToBody("if (");
      definition.addToBody(onPageChangeDef.toScript());
      definition.addToBody("(event)) {");
View Full Code Here

  String onPageChange = (String) component.getAttributes().get("onpagechange");
  if (onPageChange != null && onPageChange.length() != 0) {
      JSFunctionDefinition onPageChangeDef = new JSFunctionDefinition("event");
      onPageChangeDef.addToBody(onPageChange);
      onPageChangeDef.addToBody("; return true;");

      definition.addToBody("if (");
      definition.addToBody(onPageChangeDef.toScript());
      definition.addToBody("(event)) {");
      definition.addToBody(buffer.toString());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.