Package org.ajax4jsf.javascript

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


        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


    attachContextMenuFunction.addParameter(clientId);
    attachContextMenuFunction.addParameter(contextMenu.getEvent());
    attachContextMenuFunction.addParameter(params);

    if (isImmediate) {
        attachContextMenuBuffer.append(attachContextMenuFunction.toScript());
    } else {
      if (isOnAvailable) {
        JSFunction availableFunction = new JSFunction("Richfaces.onAvailable");
          availableFunction.addParameter(clientId);
        availableFunction.addParameter(new JSBind(attachContextMenuFunction, "contextMenu"));
View Full Code Here

    } else {
      if (isOnAvailable) {
        JSFunction availableFunction = new JSFunction("Richfaces.onAvailable");
          availableFunction.addParameter(clientId);
        availableFunction.addParameter(new JSBind(attachContextMenuFunction, "contextMenu"));
          attachContextMenuBuffer.append(availableFunction.toScript());
         
      } else if (isOnLoad) {
          JSFunction onloadFunction = new JSFunction("jQuery(document).ready");
          onloadFunction.addParameter(new JSBind(attachContextMenuFunction, "contextMenu"));
View Full Code Here

         
      } else if (isOnLoad) {
          JSFunction onloadFunction = new JSFunction("jQuery(document).ready");
          onloadFunction.addParameter(new JSBind(attachContextMenuFunction, "contextMenu"));

          attachContextMenuBuffer.append(onloadFunction.toScript());
      }
    }

    attachContextMenuBuffer.append(";");
      }
View Full Code Here

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

    ajaxFunction.addParameter(options);

    JSFunctionDefinition function = new JSFunctionDefinition("uid");
    function.addParameter("formId");
    function.addParameter("event");
    function.addToBody(ajaxFunction.toScript());

    return function.toScript();
  }

  /**
 
View Full Code Here

    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(";");

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

    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

        JSFunction function = new JSFunction("SyntaxHighlighter.all");
        writer.startElement("script", null);
        writer.writeAttribute("type", "text/javascript", null);
        writer.write("var brs = $('#" + this.getClientId(context).replaceAll(":", "\\\\\\\\:") + "').find('br');");
        writer.write("brs.length && brs.replaceWith('\\n');");
        writer.write(function.toScript());
        writer.endElement("script");
        writer.endElement("div");
    }

    public String getSourceType() {
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.