Package org.ajax4jsf.javascript

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


                        + ":" + CHANGE_COL_VISIBILITY, dataColumn.getId());

                JSFunction dropFunction = AjaxRendererUtils.buildAjaxFunction(
                        dataColumn, context);
                dropFunction.addParameter(requestOpts);
                actionScript = dropFunction.toScript();
            }// if

            writer.startElement("li", dataColumn);
            writer.writeAttribute(HTML.class_ATTRIBUTE, "dt-menu-list-item"
                    + (columnVisible ? " dt-menu-item-checked" : ""), null);
View Full Code Here


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

    protected JSFunctionDefinition getShowMenuFunction(FacesContext context,
            UIDataTable table) {
        return new RichTableMenuRenderer().createShowMenuEventFunction();
View Full Code Here

        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

    protected JSFunction getSortFunction(FacesContext context, UIDataTable table) {
        String id = table.getClientId(context);
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

                .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

    definition.addToBody("var dzOptions = this.getDropzoneOptions(); if (dzOptions.ondrop) { if (!dzOptions.ondrop.call(this, event)) return; };");
   
    JSFunction dropFunction = AjaxRendererUtils.buildAjaxFunction(column, context);
    dropFunction.addParameter(new JSReference("options"));
   
    definition.addToBody(dropFunction.toScript()).addToBody(";");
    definition.appendScript(result);
    result.append(";");

    return result.toString();
  }
View Full Code Here

      JSFunction function = new JSFunction("new RichFaces.DataTable");
      function.addParameter(component.getBaseClientId(context));
      ScriptOptions scriptOptions = new ScriptOptions(component);
      scriptOptions.addOption("sortMode", new JSFunction("new RichFaces.SortMode.Single"));
      function.addParameter(scriptOptions);
      getUtils().writeScript(context, component, function.toScript());
    }
  }
 
  @Override
  protected void doDecode(FacesContext context, UIComponent component) {
View Full Code Here

   
    composite.mergeScriptOptions(options, context, grid);
   
    JSFunction function = new JSFunction("new ClientUI.controls.grid.ScrollableGrid");
    function.addParameter(options);
    return function.toScript();
  }
 
  protected String getScriptContributions(FacesContext context, UIScrollableDataTable grid) {
    return composite.getScriptContributions(getJavaScriptVarName(context, grid), context, grid);
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    Map<String, Object> parametersMap = (Map<String, Object>) options.get("parameters");
   
    parametersMap.put(grid.getBaseClientId(context) + ":scroll", "");
    function.addParameter(options);
    String completeFunction = function.toScript()+"; return false;";
   
    return completeFunction;
   
  }
View Full Code Here

        // pass "zindex" attribute to js though the "options" attribute
        options.put("zindex", suggestionBox.getZindex());

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

    /**
     * Gets template.
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.