Examples of JSFunction


Examples of org.ajax4jsf.javascript.JSFunction

        String targetId = HtmlUtil.idsToIdSelector(getFor());
       
        targetId = HtmlUtil.expandIdSelector(targetId, this, FacesContext
                .getCurrentInstance());
       
        JSFunction invocation = new JSFunction("Richfaces.componentControl.performOperation");
        invocation.addParameter(new JSReference("event"));
        invocation.addParameter(targetId);
        invocation.addParameter(getOperation());
        invocation.addParameter(new JSReference("{" + getEncodedParametersMap() + "}"));
        invocation.addParameter(Boolean.valueOf(isDisableDefault()));
       
        return invocation.toScript();
    }
View Full Code Here

Examples of org.auraframework.util.json.JsFunction

        }
    }

    @Override
    public JsFunction getDefaultHandler() {
        return new JsFunction(ImmutableList.<String> of(),
                "try{$A.clientService.setOutdated()}catch(e){$L.clientService.setOutdated()}");
    }
View Full Code Here

Examples of org.chromium.sdk.JsFunction

      @Override
      public RelayOk evaluateGet(EvaluateCallback callback, SyncCallback syncCallback) {
        WipContextBuilder.GlobalEvaluateContext evaluateContext =
            new WipContextBuilder.GlobalEvaluateContext(valueLoader);

        JsFunction getterFunction = getGetterAsFunction();
        if (getterFunction == null) {
          throw new RuntimeException("Getter is not a function");
        }

        Map<String, SerializableValue> context = new HashMap<String, SerializableValue>(2);
View Full Code Here

Examples of org.richfaces.javascript.JSFunction

     * @param time
     * @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());
    }
View Full Code Here

Examples of org.richfaces.javascript.JSFunction

        page.executeJavaScript(function.toScript());
    }

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

        page.executeJavaScript(function.toScript());
    }
View Full Code Here

Examples of org.richfaces.javascript.JSFunction

    private String buildClickExpression(String id) {
        return "document.getElementById('" + id + "').click()";
    }

    protected void clickOnTime(int time, String id) {
        JSFunction function = new JSFunction("simulationContext.executeOnTime", time,
                new JSFunctionDefinition().addToBody(buildClickExpression(id)));

        page.executeJavaScript(function.toScript());
    }
View Full Code Here

Examples of org.richfaces.javascript.JSFunction

        }
    }

    private final static class AjaxSubmitFunctionResourceRenderer extends Renderer implements UserResourceRenderer2 {
        public void encodeToHead(FacesContext facesContext, UIComponent component) throws IOException {
            JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(component, facesContext);
            Map<String, Object> options = AjaxRendererUtils.buildEventOptions(facesContext, component, true);

            options.put("requestDelay", new JSReference("options.requestDelay"));
            options.put("similarityGroupingId",
                    new JSReference("options.similarityGroupingId || '" + component.getClientId(facesContext)
                            + "'"));
            options.put("data", new JSReference("data"));
            options.put("requestTime", new JSReference("options.requestTime"));
            options.put("timeout", new JSReference("options.timeout"));
            options.put("eventsQueue", new JSReference("options.eventsQueue"));
            options.put("implicitEventsQueue", new JSReference("options.implicitEventsQueue"));
            options.put("ignoreDupResponses", new JSReference("options.ignoreDupResponses"));
            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

Examples of org.sgx.yuigwt.yui.util.JsFunction

        /*
         * Note: due to GWT types restrictions, we couldn't represent the JSON.parse() reviver function using a Java JsObject (function return value can be anything).
         * Instead se define a js function inline using JsFunctionBuilder.
         */
        JsFunction reviver2 = new JsFunctionBuilder() {
          @Override
          public native final JsFunction buildFunction()/*-{
            return function(k, v) {
              if (k == "miscellaneous" && v > 500)
                return 999999;
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.