Package org.ajax4jsf.javascript

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


      JSFunctionDefinition onPageChangeDef = new JSFunctionDefinition("event");
      onPageChangeDef.addToBody(onPageChange);
      onPageChangeDef.addToBody("; return true;");

      definition.addToBody("if (");
      definition.addToBody(onPageChangeDef.toScript());
      definition.addToBody("(event)) {");
      definition.addToBody(buffer.toString());
      definition.addToBody("}");
  } else {
      definition.addToBody(buffer.toString());
View Full Code Here


    parametersMap.put(clientId + DATE_SCROLL, requestValue);
    ajaxFunction.addParameter(options);
    JSFunctionDefinition definition = new JSFunctionDefinition();
    definition.addParameter(requestValue);
    definition.addToBody(ajaxFunction);
    writer.write(definition.toScript());
  }

  public void writeEventHandlerFunction(FacesContext context,
    UIComponent component, String eventName) throws IOException {
View Full Code Here

    if (script!=null && !script.equals(""))
    {
      JSFunctionDefinition onEventDefinition = new JSFunctionDefinition();
      onEventDefinition.addParameter("event");
      onEventDefinition.addToBody(script);     
      writer.writeText(",\n" + eventName + ": "+onEventDefinition.toScript(), null);
    }
  }

  public String getInputValue(FacesContext context, UIComponent component) {
    UICalendar input = (UICalendar) component;
View Full Code Here

    while (iterator.hasNext()) {
      Map.Entry entry = (Map.Entry) iterator.next();
      Object value = entry.getValue();
      if (value instanceof JSFunctionDefinition) {
        JSFunctionDefinition definition = (JSFunctionDefinition) value;
        entry.setValue(definition.toScript());
      }
    }
  }

  public String getDraggableScriptOptions(FacesContext context,
View Full Code Here

    while (iterator.hasNext()) {
      Map.Entry entry = (Map.Entry) iterator.next();
      Object value = entry.getValue();
      if (value instanceof JSFunctionDefinition) {
        JSFunctionDefinition definition = (JSFunctionDefinition) value;
        entry.setValue(definition.toScript());
      }
    }
  }

  public String getDraggableScriptOptions(FacesContext context,
View Full Code Here

    parametersMap.put(clientId + DATE_SCROLL, requestValue);
    ajaxFunction.addParameter(options);
    JSFunctionDefinition definition = new JSFunctionDefinition();
    definition.addParameter(requestValue);
    definition.addToBody(ajaxFunction);
    writer.write(definition.toScript());
  }

  public void writeEventHandlerFunction(FacesContext context,
      UIComponent component, String eventName) throws IOException {
View Full Code Here

    if (script != null && !script.equals("")) {
      JSFunctionDefinition onEventDefinition = new JSFunctionDefinition();
      onEventDefinition.addParameter("event");
      onEventDefinition.addToBody(script);
      writer.writeText(",\n" + eventName + ": "
          + onEventDefinition.toScript(), null);
    }
  }

  public String getInputValue(FacesContext context, UIComponent component) {
    UICalendar input = (UICalendar) component;
View Full Code Here

        Object eventHandler = ScriptHashVariableWrapper.eventHandler.wrap("abc");

        assertTrue(eventHandler instanceof JSFunctionDefinition);

        JSFunctionDefinition handlerFunction = (JSFunctionDefinition) eventHandler;
        assertEquals("function(event){abc}", dehydrate(handlerFunction.toScript()));

        Object arrayObject = ScriptHashVariableWrapper.asArray.wrap("header, footer");
        assertEquals("[\"header\",\"footer\"]", dehydrate(ScriptUtils.toScript(arrayObject)));
    }
View Full Code Here

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

    return function.toScript();
  }

  /**
   * Return accepted types map
   *
 
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.