Package org.ajax4jsf.javascript

Examples of org.ajax4jsf.javascript.JSFunction.toScript()


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


   
    mergeScriptOptions(options, context, grid);
   
    JSFunction function = new JSFunction("new ClientUI.controls.grid.ScrollableGrid");
    function.addParameter(options);
    return function.toScript();
  }
 
  protected String getScriptContributions(FacesContext context, UIScrollableDataTable grid) {
    return super.getScriptContributions(getJavaScriptVarName(context, grid), context, grid);
  }
View Full Code Here

    Map options = AjaxRendererUtils.buildEventOptions(context, grid);
    options.put("oncomplete", AjaxFunctionBuilder.getOnComplete(context, grid, AjaxFunctionBuilder.SCROLL));
    Map parametersMap = (Map)options.get("parameters");
    parametersMap.put(grid.getBaseClientId(context) + ":scroll", "");
    function.addParameter(options);
    String completeFunction = function.toScript()+"; return false;";
   
    return completeFunction;
   
  }
View Full Code Here

    eventsMap.put(new JSReference("delay"), new Integer(toolTip.getDelay()));
   
    JSFunction function = AjaxRendererUtils.buildAjaxFunction(component, context);
    JSReference ref = new JSReference("ajaxOptions");
    function.addParameter(ref);
    String ajaxFunc = function.toScript();
   
    Map ajaxOptions = buildEventOptions(context, toolTip);
   
    ret.append("new ToolTip(" + ScriptUtils.toScript(eventsMap)).append(comma).append(quot).append( toolTip.getClientId(context)).append(quot).append(comma).
    append(quot).append(parentClientId).append(quot).append(comma).
View Full Code Here

                || attributes.get("fetchValue") != null) {
            options.put("select", attributes.get("selectValueClass"));
        }

        submitSuggest.addParameter(options);
        script.append(submitSuggest.toScript()).append(";\n");
        return script.toString();
    }

    /**
     * Gets template.
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

   
    ajaxFunction.addParameter(options);

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

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

      ajaxFunction.addParameter(options);
     
      ResponseWriter responseWriter = facesContext.getResponseWriter();
      responseWriter.startElement(HTML.SCRIPT_ELEM, component);
      responseWriter.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
      responseWriter.writeText("var " + AJAX_SUBMIT + " = function(data, options) {" + ajaxFunction.toScript() + "};", null);
      responseWriter.endElement(HTML.SCRIPT_ELEM);
    }
   
  }
 
View Full Code Here

   * @param data
   * @param builder
   */
  protected void ajax(int time, String data, ParametersBuilder builder) {
    JSFunction function = new JSFunction("simulationContext.ajax", time, data, builder.getParameters());
    page.executeJavaScript(function.toScript());
  }

  protected void executeOnTime(int time, String expression) {
    JSFunction function = new JSFunction("simulationContext.executeOnTime",
        time, new JSFunctionDefinition().addToBody(expression));
View Full Code Here

  protected void executeOnTime(int time, String expression) {
    JSFunction function = new JSFunction("simulationContext.executeOnTime",
        time, new JSFunctionDefinition().addToBody(expression));
 
    page.executeJavaScript(function.toScript());
  }

  private String buildClickExpression(String id) {
    return "document.getElementById('" + id + "').click()";
  }
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.