Examples of JSReference


Examples of org.ajax4jsf.javascript.JSReference

   
  }
 
  public String onSortAjaxUpdate(FacesContext context, UIScrollableDataTable grid){
   
    JSReference sortColumn = new JSReference("event.column");
    JSReference sortOrder = new JSReference("event.order");
    JSReference sortStartRow = new JSReference("event.startRow");
    JSReference sortIndex = new JSReference("event.index");
   
    Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, grid);
   
    @SuppressWarnings("unchecked")
    Map<String, Object> parametersMap = (Map)options.get("parameters");
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

      definition.addToBody(preSendAjaxRequestFunction.toScript()).addToBody(";");
    }
    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.addToBody("};");
   
View Full Code Here

Examples of org.ajax4jsf.javascript.JSReference

       
        String eventShow = (toolTip.isAttached()) ? toolTip.getShowEvent() : "";
        if (eventShow.startsWith("on")) {
            eventShow = eventShow.substring(2);
        }
        eventsMap.put(new JSReference("showEvent"), eventShow);

        String eventHide = (toolTip.isAttached()) ? toolTip.getHideEvent() : "";
        if (eventHide.startsWith("on")) {
            eventHide = eventHide.substring(2);
        }
        eventsMap.put(new JSReference("hideEvent"), eventHide);

        eventsMap.put(new JSReference("delay"), new Integer(toolTip.getShowDelay()));
        eventsMap.put(new JSReference("hideDelay"), new Integer(toolTip.getHideDelay()));
       
        JSFunctionDefinition ajaxFunc = null;
        if (AJAX_MODE.equalsIgnoreCase(toolTip.getMode())) {
            ajaxFunc = new JSFunctionDefinition("event", "ajaxOptions");
            JSFunction function = AjaxRendererUtils.buildAjaxFunction(component, context);
            JSReference ref = new JSReference("ajaxOptions");
            function.addParameter(ref);
            ajaxFunc.addToBody(function);
        }
       
        Map<String, Object> ajaxOptions = buildEventOptions(context, toolTip, targetClientId);
        ajaxOptions.putAll(getParamsMap(context, toolTip));
       
        Map<JSReference, Object> funcMap = new HashMap<JSReference, Object>();
        JSFunctionDefinition completeFunc = getUtils().getAsEventHandler(
                context, component, "oncomplete", "; return true;");
        funcMap.put(new JSReference("oncomplete"), completeFunc);

        JSFunctionDefinition hideFunc = getUtils().getAsEventHandler(
                context, component, "onhide", "; return true;");
        funcMap.put(new JSReference("onhide"), hideFunc);

        JSFunctionDefinition showFunc = getUtils().getAsEventHandler(
                context, component, "onshow", "; return true;");
        funcMap.put(new JSReference("onshow"), showFunc);
       
        StringBuffer ret = new StringBuffer();
        ret.append("new ToolTip(").append(ScriptUtils.toScript(eventsMap)).append(COMMA)
           .append(ScriptUtils.toScript(funcMap)).append(COMMA)
           .append(QUOT).append(toolTip.getClientId(context)).append(QUOT_COMMA)
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

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(FileUploadConstants.FILE_UPLOAD_ACTION, action);
    parameters.put(FileUploadConstants.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

       
        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

            }
           
            ScriptUtils.addEncodedString(result, name);
            result.append(": ");
            result.append(ScriptUtils.toScript(escape ? value
                    : new JSReference(value.toString())));
           
            shouldClose = true;
        }
       
        return result.toString();
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 (oncomplete != null) {
      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
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.