Package org.ajax4jsf.javascript

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


                if (ajax) {
                    JSFunction function = AjaxRendererUtils.buildAjaxFunction(tab,
                            context);
                    Map eventOptions = AjaxRendererUtils.buildEventOptions(context,
                            tab);
                    function.addParameter(eventOptions);

                    StringBuffer buffer = new StringBuffer();
                    function.appendScript(buffer);
                    //TODO remove this.onclick = null
                    buffer.append("; return false; this.onclick = null;");
View Full Code Here


       
        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()));
       
View Full Code Here

        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

    //TODO nick - remove as legacy
    definition.addToBody("Object.extend(options.parameters, drag.getParameters());");
    definition.addToBody("var dzOptions = this.getDropzoneOptions(); if (dzOptions.ondrop) { if (!dzOptions.ondrop.call(this, event)) return; };");
   
    JSFunction dropFunction = AjaxRendererUtils.buildAjaxFunction(component, context);
    dropFunction.addParameter(new JSReference("options"));
   
    definition.addToBody(dropFunction.toScript()).addToBody(";");
    definition.appendScript(result);
    result.append(";");
View Full Code Here

                .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

       
        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

        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();
    }
   
    public String getEncodedParametersMap() {
View Full Code Here

      throws IOException {
    ResponseWriter writer = context.getResponseWriter();

    JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(calendar,
        context, AjaxRendererUtils.AJAX_FUNCTION_NAME);
    ajaxFunction.addParameter(JSReference.NULL);
   
    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put(calendar.getClientId(context) + CURRENT_DATE_PRELOAD, Boolean.TRUE);
   
    Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, calendar, params);
View Full Code Here

      oncompleteDefinition.addToBody(oncomplete);
    }

    options.put("oncomplete", oncompleteDefinition);
    JSReference requestValue = new JSReference("requestValue");
    ajaxFunction.addParameter(options);
    JSFunctionDefinition definition = new JSFunctionDefinition();
    definition.addParameter(requestValue);
    definition.addToBody(ajaxFunction);
    writer.write(definition.toScript());
  }
View Full Code Here

  public static Object formatDate(Date date) {
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(date);
    JSFunction result = new JSFunction("new Date");
    result.addParameter(Integer.valueOf(calendar.get(Calendar.YEAR)));
    result.addParameter(Integer.valueOf(calendar.get(Calendar.MONTH)));
    result.addParameter(Integer.valueOf(calendar.get(Calendar.DATE)));

    return result;
  }
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.