Package org.ajax4jsf.javascript

Examples of org.ajax4jsf.javascript.JSFunction


    protected String getMessageContent() {
        return "";
    }

    protected Object sendMessage() {
        JSFunction clientSideFunction = new JSFunction("RichFaces.csv." + getJavaScriptFunctionName(), COMPONENT,
            getErrorMessage());
        return qunit.runScript(clientSideFunction.toScript());
    }
View Full Code Here


     * @param time
     * @param data
     * @param builder
     */
    protected void ajax(int time, String data, ParametersBuilder builder) {
        JSFunction function = new JSFunction("simulationContext.ajax", time, data, builder.getParameters());
        executeJavaScriptLogged(function.toScript());
    }
View Full Code Here

        JSFunction function = new JSFunction("simulationContext.ajax", time, data, builder.getParameters());
        executeJavaScriptLogged(function.toScript());
    }

    protected void executeOnTime(int time, String expression) {
        JSFunction function = new JSFunction("simulationContext.executeOnTime", time,
            new JSFunctionDefinition().addToBody(expression));

        executeJavaScriptLogged(function.toScript());
    }
View Full Code Here

    private String buildClickExpression(String id) {
        return "document.getElementById('" + id + "').click()";
    }

    protected void clickOnTime(int time, String id) {
        JSFunction function = new JSFunction("simulationContext.executeOnTime", time,
            new JSFunctionDefinition().addToBody(buildClickExpression(id)));

        executeJavaScriptLogged(function.toScript());
    }
View Full Code Here

            }
        }
    }

    protected Object validateOnClient(Validator validator) throws ValidationException {
        JSFunction clientSideFunction = new JSFunction("RichFaces.csv." + getJavaScriptFunctionName(), criteria.getValue(),
            TEST_COMPONENT_ID, getJavaScriptOptions(), getErrorMessage(validator));
        return qunit.runScript(clientSideFunction.toScript());
    }
View Full Code Here

    }

    protected abstract Class<?> getBeanType();

    protected Object validateOnClient(Validator validator) throws ValidationException {
        JSFunction clientSideFunction = new JSFunction("RichFaces.csv." + getJavaScriptFunctionName(), criteria.getValue(),
            TEST_COMPONENT_ID, getJavaScriptOptions(), getErrorMessage());
        return qunit.runScript(clientSideFunction.toScript());
    }
View Full Code Here

    protected void compareResult(Object convertedValue, Object jsConvertedValue) {
        assertEquals(convertedValue, jsConvertedValue);
    }

    protected Object convertOnClient(Converter converter) throws ConverterException {
        JSFunction clientSideFunction = new JSFunction("RichFaces.csv." + getJavaScriptFunctionName(), criteria.getValue(),
            TEST_COMPONENT_ID, getJavaScriptOptions(), getErrorMessage(converter));
        return qunit.runScript(clientSideFunction.toScript());
    }
View Full Code Here

        String expandMode = isNested ? "client" : subTable.getExpandMode();
        options.put("expandMode", expandMode);
        options.put("isNested", isNested);
        options.put("eventOptions", AjaxRendererUtils.buildEventOptions(facesContext, subTable));

        JSFunction jsFunction = new JSFunction("new RichFaces.ui.CollapsibleSubTable");
        jsFunction.addParameter(id);
        jsFunction.addParameter(formId);
        jsFunction.addParameter(options);

        writer.startElement(HtmlConstants.SCRIPT_ELEM, subTable);
        writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.JAVASCRIPT_TYPE, null);
        writer.writeText(jsFunction.toScript(), null);
        writer.endElement(HtmlConstants.SCRIPT_ELEM);
    }
View Full Code Here

        } else {
            writer.startElement(HtmlConstants.SCRIPT_ELEM, table);
            writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.TEXT_JAVASCRIPT_TYPE, null);

            String cssText = getCSSText(context, table);
            JSFunction function = new JSFunction("RichFaces.utils.addCSSText", cssText, table.getClientId(context) + ":st");

            writer.writeText(function.toScript(), null);

            writer.endElement(HtmlConstants.SCRIPT_ELEM);
        }
    }
View Full Code Here

        if (!handlers.isEmpty()) {
            if (handlers.size() == 1) {
                result = handlers.get(0);
            } else {
                JSFunction jsFunction = new JSFunction("jsf.util.chain", JSReference.THIS, JSReference.EVENT);

                for (String handler : handlers) {
                    jsFunction.addParameter(handler);
                }

                result = jsFunction.toScript();
            }
        }

        return result;
    }
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.