Package org.ajax4jsf.javascript

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


    oncompleteDefinition.addParameter("request");
    oncompleteDefinition.addParameter("event");
    oncompleteDefinition.addParameter("data");
    oncompleteDefinition.addToBody("this.calendar.load(data, true);");
    if (oncomplete != null) {
      oncompleteDefinition.addToBody(oncomplete);
    }

    options.put("oncomplete", oncompleteDefinition);
    JSReference requestValue = new JSReference("requestValue");
    ajaxFunction.addParameter(options);
View Full Code Here


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

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

    ResponseWriter writer = context.getResponseWriter();
    Object script = component.getAttributes().get(eventName);
    if (script != null && !script.equals("")) {
      JSFunctionDefinition onEventDefinition = new JSFunctionDefinition();
      onEventDefinition.addParameter("event");
      onEventDefinition.addToBody(script);
      writer.writeText(",\n" + eventName + ": "
          + onEventDefinition.toScript(), null);
    }
  }
View Full Code Here

      String returnScript = null;      
      Object script = slider.getAttributes().get(eventName);
      if(script != null && !script.equals("")){
        JSFunctionDefinition jsFunctionDefinition  = new JSFunctionDefinition();
        jsFunctionDefinition.addParameter("event");
        jsFunctionDefinition.addToBody(script);
        returnScript = jsFunctionDefinition.toScript();
     
     
      return returnScript;
    }
View Full Code Here

                context, table);
        @SuppressWarnings("unchecked")
        Map<String, Object> parameters = (Map<String, Object>) eventOptions
                .get("parameters");
        parameters.put(GROUP_TOGGLE_ACTION_NAME, GROUP_TOGGLE_ACTION_NAME);
        definition.addToBody("var options = ").addToBody(
                ScriptUtils.toScript(eventOptions)).addToBody(";\n");
        definition
                .addToBody("options.parameters['groupIndex'] = groupIndex;\n");
        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
                context);
View Full Code Here

        Map<String, Object> parameters = (Map<String, Object>) eventOptions
                .get("parameters");
        parameters.put(GROUP_TOGGLE_ACTION_NAME, GROUP_TOGGLE_ACTION_NAME);
        definition.addToBody("var options = ").addToBody(
                ScriptUtils.toScript(eventOptions)).addToBody(";\n");
        definition
                .addToBody("options.parameters['groupIndex'] = groupIndex;\n");
        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
                context);
        ajaxFunction.addParameter(new JSReference("options"));
        definition.addToBody(ajaxFunction.toScript()).addToBody(";\n");
View Full Code Here

        definition
                .addToBody("options.parameters['groupIndex'] = groupIndex;\n");
        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
                context);
        ajaxFunction.addParameter(new JSReference("options"));
        definition.addToBody(ajaxFunction.toScript()).addToBody(";\n");
        return definition;
    }// getSortFunction

    protected JSFunction getGroupFunction(FacesContext context,
            UIDataTable table) {
View Full Code Here

                context, table);
        @SuppressWarnings("unchecked")
        Map<String, Object> parameters = (Map<String, Object>) eventOptions
                .get("parameters");
        parameters.put(COL_RESIZE_ACTION_NAME, COL_RESIZE_ACTION_NAME);
        definition.addToBody("var options = ").addToBody(
                ScriptUtils.toScript(eventOptions)).addToBody(";\n");
        definition
                .addToBody("options.parameters['columnWidths'] = columnWidths;\n");

        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
View Full Code Here

        Map<String, Object> parameters = (Map<String, Object>) eventOptions
                .get("parameters");
        parameters.put(COL_RESIZE_ACTION_NAME, COL_RESIZE_ACTION_NAME);
        definition.addToBody("var options = ").addToBody(
                ScriptUtils.toScript(eventOptions)).addToBody(";\n");
        definition
                .addToBody("options.parameters['columnWidths'] = columnWidths;\n");

        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
                context);
        ajaxFunction.addParameter(new JSReference("options"));
View Full Code Here

                .addToBody("options.parameters['columnWidths'] = columnWidths;\n");

        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
                context);
        ajaxFunction.addParameter(new JSReference("options"));
        definition.addToBody(ajaxFunction.toScript()).addToBody(";\n");
        return definition;
    }

    protected JSFunction getChangeColumnVisibilityFunction(
            FacesContext context, UIDataTable table) {
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.