Package org.ajax4jsf.javascript

Examples of org.ajax4jsf.javascript.JSFunction


  }
        options.append("}");

        JSReference reference = new JSReference(options.toString());
       
      JSFunction function = new JSFunction("Richfaces.DFSControl.Slider");
      function.addParameter(clientId + "slider-handle");
      function.addParameter(clientId + "slider-track");
      function.addParameter(reference);
      function.appendScript(script);
      script.append(";");
     
      return script.toString();
   
View Full Code Here


        String sliderClientId = slider.getClientId(context);

        String id = slider.getId();

      JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(slider,context);
      ajaxFunction.addParameter(AjaxRendererUtils.buildEventOptions(
        context, slider));
      StringBuffer script= new StringBuffer();
        ajaxFunction.appendScript(script);
        script.append("; return false");
        String sliderHandlerScript = "function updateSlider1(event, value) {\n" +
                                                "$('"+ clientId +"slider_val').value = value;\n" +
                                                script.toString() +
                                                "}\n";
View Full Code Here

    return selectionHolderInputId;
  }

  protected String getAjaxScript(FacesContext context, UITree tree) {
    String id = tree.getBaseClientId(context);
    JSFunction function = AjaxRendererUtils
    .buildAjaxFunction(tree, context);
    Map eventOptions = AjaxRendererUtils.buildEventOptions(context, tree);
    Map parameters = (Map) eventOptions.get("parameters");
    parameters.remove(id);
    parameters.put(id + UITree.SELECTED_NODE_PARAMETER_NAME,
        new JSReference("event.selectedNode"));
    function.addParameter(eventOptions);
    StringBuffer buffer = new StringBuffer();
    function.appendScript(buffer);
    buffer.append("; return false;");
    return buffer.toString();
  }
View Full Code Here

        }
    }

    public String createClientDataTable(FacesContext context,
            UIExtendedDataTable table) {
        JSFunction function = new JSFunction("new ExtendedDataTable.DataTable");
        function.addParameter(table.getBaseClientId(context));
        ScriptOptions scriptOptions = new ScriptOptions(table);
        // add on resize column AJAX function
        scriptOptions.addOption(ON_RESIZE_FUNCTION, getOnResizeFunctionDef(
                context, table));
        scriptOptions.addOption(SORT_FUNCTION, getSortFunctionDef(context,
                table));
        scriptOptions.addOption(SHOW_MENU_FUNCTION, getShowMenuFunction(
                context, table));
        /* Not needed if we do not save open/close state */
        scriptOptions.addOption(ON_GROUP_TOGGLE_FUNCTION,
                getOnGroupToggleFunctionDef(context, table));
        scriptOptions.addOption("minColumnWidth", MIN_COLUMN_WIDTH);
        composite.mergeScriptOptions(scriptOptions, context, table);
        function.addParameter(scriptOptions);
        return function.toScript();
    }
View Full Code Here

        }
        definition.addToBody("var options = ").addToBody(
                ScriptUtils.toScript(eventOptions)).addToBody(";\n");
        definition.addToBody("options.parameters['" + SORT_FILTER_PARAMETER
                + "'] = columnId;\n");
        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
                context);
        ajaxFunction.addParameter(new JSReference("options"));
        definition.addToBody(ajaxFunction.toScript()).addToBody(";\n");
        return definition;
    }// getSortFunction
View Full Code Here

                context, table);
        if (onAjaxCompleteFunction != null) {
            requestOpts.put(AjaxRendererUtils.ONCOMPLETE_ATTR_NAME,
                    onAjaxCompleteFunction);
        }
        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
                context);
        ajaxFunction.addParameter(requestOpts);
        return ajaxFunction;
    }// getSortFunction
View Full Code Here

        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");
        return definition;
    }// getSortFunction
View Full Code Here

                context, table);
        if (onAjaxCompleteFunction != null) {
            requestOpts.put(AjaxRendererUtils.ONCOMPLETE_ATTR_NAME,
                    onAjaxCompleteFunction);
        }
        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
                context);
        ajaxFunction.addParameter(requestOpts);
        return ajaxFunction;
    }// getSortFunction
View Full Code Here

        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"));
        definition.addToBody(ajaxFunction.toScript()).addToBody(";\n");
        return definition;
    }
View Full Code Here

        }
        parameters.put(
                table.getClientId(context) + ":" + CHANGE_COL_VISIBILITY,
                "{columnId}");

        JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table,
                context);
        ajaxFunction.addParameter(requestOpts);
        return ajaxFunction;
    }
View Full Code Here

TOP

Related Classes of org.ajax4jsf.javascript.JSFunction

Copyright © 2018 www.massapicom. 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.