Examples of JSReference


Examples of org.ajax4jsf.javascript.JSReference

    //TODO 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(column, context);
    dropFunction.addParameter(new JSReference("options"));
   
    definition.addToBody(dropFunction.toScript()).addToBody(";");
    definition.appendScript(result);
    result.append(";");
View Full Code Here

Examples of org.ajax4jsf.javascript.JSReference

        definition.addParameter("event");
        definition.addParameter("columnId");
        definition.addParameter("menuId");
        JSFunction invocation = new JSFunction(
                "Richfaces.componentControl.performOperation");
        invocation.addParameter(new JSReference("event"));
        invocation.addParameter(new JSReference("menuId"));
        invocation.addParameter("show");
        // invocation.addParameter(new JSReference("{'columnId':columnId}"));
        invocation.addParameter(new JSReference("{}"));
        invocation.addParameter(Boolean.FALSE);
        definition.addToBody(invocation.toScript()).addToBody(";\n");
        return definition;
    }
View Full Code Here

Examples of org.ajax4jsf.javascript.JSReference

        UIParameter parameter = (UIParameter) kid;
        String name = parameter.getName();
        Object value = parameter.getValue();

        if ((parameter instanceof JavaScriptParameter) && ((JavaScriptParameter) parameter).isNoEscape()) {
      value = new JSReference(String.valueOf(value));
        }

        params.put(name, value);
    }
      }
View Full Code Here

Examples of org.ajax4jsf.javascript.JSReference

    if(eventHide.startsWith("on")){
      eventHide = eventHide.substring(2);
    }
   
    Map<JSReference, Object> eventsMap = new HashMap<JSReference, Object>();
    eventsMap.put(new JSReference("showEvent"), eventShow);
    eventsMap.put(new JSReference("hideEvent"), eventHide);
    eventsMap.put(new JSReference("delay"), new Integer(toolTip.getShowDelay()));
    eventsMap.put(new JSReference("hideDelay"), new Integer(toolTip.getHideDelay()));
   
    JSFunction function = AjaxRendererUtils.buildAjaxFunction(component, context);
    JSReference ref = new JSReference("ajaxOptions");
    function.addParameter(ref);
    String ajaxFunc = function.toScript();
       
    Map<String, Object> ajaxOptions = buildEventOptions(context, toolTip, targetClientId);
    ajaxOptions.putAll(getParamsMap(context, toolTip));
    JSFunctionDefinition completeFunc = getUtils().getAsEventHandler(context, component, "oncomplete", "; return true;");
    JSFunctionDefinition hideFunc = getUtils().getAsEventHandler(context, component,"onhide", "; return true;");
    JSFunctionDefinition showFunc = getUtils().getAsEventHandler(context, component,"onshow", "; return true;");
   
    Map<JSReference, Object> funcMap = new HashMap<JSReference, Object>();
    funcMap.put(new JSReference("oncomplete"), completeFunc);
    funcMap.put(new JSReference("onhide"), hideFunc);
    funcMap.put(new JSReference("onshow"), showFunc);
   
   
    ret.append("new ToolTip(" + ScriptUtils.toScript(eventsMap)).append(comma).append(ScriptUtils.toScript(funcMap))
    .append(comma).append(quot).append( toolTip.getClientId(context)).append(quot).append(comma).
    append(quot).append(targetClientId).append(quot).append(comma).
View Full Code Here

Examples of org.ajax4jsf.javascript.JSReference

    String clientId = component.getClientId(context);
    String containerId = (String) variables.getVariable("containerId");
    JSFunction ajaxFunction = new JSFunction(
        AjaxRendererUtils.AJAX_FUNCTION_NAME);
    ajaxFunction.addParameter(containerId);
    ajaxFunction.addParameter(new JSReference("formId"));
    ajaxFunction.addParameter(new JSReference("event"));
    // AjaxRendererUtils.buildAjaxFunction(
    // component, context);

    Map options = AjaxRendererUtils.buildEventOptions(context, component);
    Map parameters = (Map) options.get("parameters");
    parameters.put("action", action);
    parameters.put(Filter.UPLOAD_FILES_ID, new JSReference("uid"));
    parameters.put(clientId, clientId);
    parameters.put(AjaxRendererUtils.AJAX_SINGLE_ATTR, clientId);
    if (oncomplete != null) {
      options.put("onbeforedomupdate", oncomplete);
    }
View Full Code Here

Examples of org.ajax4jsf.javascript.JSReference

    //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

Examples of org.ajax4jsf.javascript.JSReference

      if (child instanceof UIParameter) {
        UIParameter parameter = ((UIParameter) child);
        String name = parameter.getName();
        func.addParameter(name);
        // Put parameter name to AJAX.Submit parameter, with default value.
        JSReference reference = new JSReference(name);
        if (null != parameter.getValue()) {
          reference = new JSReference(name + "||"
              + ScriptUtils.toScript(parameters.get(name)));

        }
        // Replace parameter value to reference.
        parameters.put(name, reference);
View Full Code Here

Examples of org.ajax4jsf.javascript.JSReference

    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.ajax4jsf.javascript.JSReference

          result.append(", ");
        }

        ScriptUtils.addEncodedString(result, name);
        result.append(": ");
        result.append(ScriptUtils.toScript(escape ? value : new JSReference(value.toString())));
       
        shouldClose = true;
      }
    }
   
View Full Code Here

Examples of org.ajax4jsf.javascript.JSReference

    StringBuffer script = new StringBuffer("\n");
    if (isAjaxMode(component) && progressBar.isEnabled()) {
      JSFunction function = AjaxRendererUtils.buildAjaxFunction(
          component, context, AJAX_POLL_FUNCTION);

      function.addParameter(new JSReference("$('" + clientId
          + "').component.options"));
      function.appendScript(script);

      pollScript.append(script);
    } else {
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.