Package org.ajax4jsf.javascript

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


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

  protected String getRootContextPath() {
    return this.getClass().getPackage().getName().replace('.', '/');
  }
View Full Code Here


                || attributes.get("fetchValue") != null) {
            options.put("select", attributes.get("selectValueClass"));
        }

        submitSuggest.addParameter(options);
        script.append(submitSuggest.toScript()).append(";\n");
       
        return "Richfaces.onAvailable('" + targetId + "', function() {" + script.toString() + "});";
    }

    /**
 
View Full Code Here

    invocation.addParameter(replaceBackSlashes(targetId));
    invocation.addParameter(getOperation());
    invocation.addParameter(new JSReference("{" + getEncodedParametersMap() + "}"));
    invocation.addParameter(Boolean.valueOf(isDisableDefault()));
   
    return invocation.toScript();


  }

  protected String replaceBackSlashes(String src) {
View Full Code Here

            function.addToBody(onobjectchange);
            options.put("onobjectchange", function);
        }

        submitSuggest.addParameter(options);
        script.append(submitSuggest.toScript()).append(";\n");
        return "Richfaces.onAvailable('" + targetId + "', function() {" + script.toString() + "});";
    }

    /**
     * Gets template.
View Full Code Here

        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

       
        JSFunction invocation = new JSFunction("Richfaces.componentControl.performOperation");
        invocation.addParameter(new JSReference("event"));
        addOptions(invocation, getEvent(), targetId, getOperation());
       
        return invocation.toScript();
    }
   
    private static boolean isContextMenuEvent(String event) {
      return ("contextmenu".equalsIgnoreCase(event) || "oncontextmenu".equalsIgnoreCase(event));
    }
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

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.