Package org.ajax4jsf.javascript

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


    }// getOnGroupToggleFunctionDef

    protected JSFunctionDefinition getOnResizeFunctionDef(FacesContext context,
            UIDataTable table) {
        JSFunctionDefinition definition = new JSFunctionDefinition();
        definition.addParameter("event");
        definition.addParameter("columnWidths");

        Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(
                context, table);
        @SuppressWarnings("unchecked")
View Full Code Here


    protected JSFunctionDefinition getOnResizeFunctionDef(FacesContext context,
            UIDataTable table) {
        JSFunctionDefinition definition = new JSFunctionDefinition();
        definition.addParameter("event");
        definition.addParameter("columnWidths");

        Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(
                context, table);
        @SuppressWarnings("unchecked")
        Map<String, Object> parameters = (Map<String, Object>) eventOptions
View Full Code Here

     
      String returnScript = null;      
      Object script = slider.getAttributes().get(eventName);
      if(script != null && !script.equals("")){
        JSFunctionDefinition jsFunctionDefinition  = new JSFunctionDefinition();
        jsFunctionDefinition.addParameter("event");
        jsFunctionDefinition.addToBody(script);
        returnScript = jsFunctionDefinition.toScript();
     
     
      return returnScript;
View Full Code Here

        Object enterScript = panelBarItem.getAttributes().get("onenter");
        Object leaveScript = panelBarItem.getAttributes().get("onleave");
       
        if (enterScript != null && !enterScript.equals("")) {
          JSFunctionDefinition onenter = new JSFunctionDefinition();
          onenter.addParameter("event");
          onenter.addToBody(enterScript);
          item.put("onenter", onenter);
        } else {
          item.put("onenter", "");
        }
View Full Code Here

          item.put("onenter", "");
        }
       
        if (leaveScript != null && !leaveScript.equals("")) {
          JSFunctionDefinition onleave = new JSFunctionDefinition();
          onleave.addParameter("event");
          onleave.addToBody(leaveScript);
          item.put("onleave", onleave);
        } else {
          item.put("onleave", "");
        }
View Full Code Here

     
      Object changeScript = panelBar.getAttributes().get("onitemchange");
     
      if (changeScript != null && !changeScript.equals("")) {
        JSFunctionDefinition function =  new JSFunctionDefinition();
        function.addParameter("event");
        function.addToBody(changeScript);
        options.addOption("onitemchange",function);
      } else {
        options.addOption("onitemchange","");
      }
View Full Code Here

      options.addOption("ajax", ajaxContext.isAjaxRequest());
     
         
      StringBuffer script = new StringBuffer();
      JSFunction function = new JSFunction("new Richfaces.PanelBar");
      function.addParameter(panelBar.getClientId(context));
      function.addParameter(options);
      function.appendScript(script);
     
      ResponseWriter writer = context.getResponseWriter();
      writer.startElement(HTML.SCRIPT_ELEM, panelBar);
View Full Code Here

     
         
      StringBuffer script = new StringBuffer();
      JSFunction function = new JSFunction("new Richfaces.PanelBar");
      function.addParameter(panelBar.getClientId(context));
      function.addParameter(options);
      function.appendScript(script);
     
      ResponseWriter writer = context.getResponseWriter();
      writer.startElement(HTML.SCRIPT_ELEM, panelBar);
      writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
View Full Code Here

    options.put("onbeforedomupdate", new JSReference("callback"));
   
    ajaxFunction.addParameter(options);

    JSFunctionDefinition function = new JSFunctionDefinition("uid", "action", "callback");
    function.addParameter("event");
    function.addToBody(ajaxFunction.toScript());

    return function.toScript();
  }
 
View Full Code Here

    Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, calendar, params, true);
    options.put("calendar", JSReference.THIS);

    String oncomplete = AjaxRendererUtils.getAjaxOncomplete(calendar);
    JSFunctionDefinition oncompleteDefinition = new JSFunctionDefinition();
    oncompleteDefinition.addParameter("request");
    oncompleteDefinition.addParameter("event");
    oncompleteDefinition.addParameter("data");
    oncompleteDefinition.addToBody("this.calendar.load(data, true);");
    if (oncomplete != null) {
      oncompleteDefinition.addToBody(oncomplete);
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.