Examples of OmniPartialViewContext


Examples of org.omnifaces.context.OmniPartialViewContext

   * Execute the given scripts on complete of the current ajax response.
   * @param scripts The scripts to be executed.
   * @see OmniPartialViewContext#addCallbackScript(String)
   */
  public static void oncomplete(String... scripts) {
    OmniPartialViewContext context = OmniPartialViewContext.getCurrentInstance();

    for (String script : scripts) {
      context.addCallbackScript(script);
    }
  }
View Full Code Here

Examples of org.omnifaces.context.OmniPartialViewContext

  public static void data(Object... namesValues) {
    if (namesValues.length % 2 != 0) {
      throw new IllegalArgumentException(String.format(ERROR_ARGUMENTS_LENGTH, namesValues.length));
    }

    OmniPartialViewContext context = OmniPartialViewContext.getCurrentInstance();

    for (int i = 0; i < namesValues.length; i+= 2) {
      if (!(namesValues[i] instanceof String)) {
        String type = (namesValues[i]) != null ? namesValues[i].getClass().getName() : "null";
        throw new IllegalArgumentException(String.format(ERROR_ARGUMENT_TYPE, type, namesValues[i]));
      }

      context.addArgument((String) namesValues[i], namesValues[i + 1]);
    }
  }
View Full Code Here

Examples of org.omnifaces.context.OmniPartialViewContext

   * <code>OmniFaces.Ajax.data</code>.
   * @param data The mapping of data arguments.
   * @see OmniPartialViewContext#addArgument(String, Object)
   */
  public static void data(Map<String, Object> data) {
    OmniPartialViewContext context = OmniPartialViewContext.getCurrentInstance();

    for (Entry<String, Object> entry : data.entrySet()) {
      context.addArgument(entry.getKey(), entry.getValue());
    }
  }
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.