Package org.directwebremoting

Examples of org.directwebremoting.ScriptBuffer


     * @param windowName The new window name for the page
     * @return The script to send to the browser
     */
    public static ScriptBuffer getRemoteHandleNewWindowNameScript(String windowName)
    {
        ScriptBuffer script = new ScriptBuffer();
        script.appendCall("r.handleNewWindowName", windowName);
        return script;
    }
View Full Code Here


     * @param params The data to pass to the function
     * @return The script to send to the browser
     */
    public static ScriptBuffer getRemoteExecuteFunctionScript(String id, Object[] params)
    {
        ScriptBuffer script = new ScriptBuffer();
        script.appendCall("r.handleFunctionCall", id, params);
        return script;
    }
View Full Code Here

     * @param params The data to pass to the function
     * @return The script to send to the browser
     */
    public static ScriptBuffer getRemoteExecuteObjectScript(String id, String methodName, Object[] params)
    {
        ScriptBuffer script = new ScriptBuffer();
        script.appendCall("r.handleObjectCall", id, methodName, params);
        return script;
    }
View Full Code Here

     * @param data The new value for the client object property
     * @return The script to send to the browser
     */
    public static ScriptBuffer getRemoteSetObjectScript(String id, String propertyName, Object data)
    {
        ScriptBuffer script = new ScriptBuffer();
        script.appendCall("r.handleSetCall", id, propertyName, data);
        return script;
    }
View Full Code Here

     * @param id The registered function name
     * @return The script to send to the browser
     */
    public static ScriptBuffer getRemoteCloseFunctionScript(String id)
    {
        ScriptBuffer script = new ScriptBuffer();
        script.appendCall("r.handleFunctionClose", id);
        return script;
    }
View Full Code Here

     */
    public static ScriptBuffer createForeignWindowProxy(String windowName, ScriptBuffer original)
    {
        String proxy = JavascriptUtil.escapeJavaScript(original.toString());

        ScriptBuffer reply = new ScriptBuffer();
        reply.appendCall("r.handleForeign", windowName, proxy);
        reply.appendData(proxy);
        return reply;
    }
View Full Code Here

     * @param function The script.aculo.us effect to employ
     * @param options A string containing options to pass to the script.aculo.us effect, as specified at http://script.aculo.us/
     */
    private static void callEffect(String elementId, String function, String options)
    {
        ScriptBuffer script = new ScriptBuffer();
        script.appendScript("new Effect.").appendScript(function).appendScript("('").appendScript(elementId).appendScript("'");
        if (options != null && options.length() > 0)
        {
            script.appendScript(", ").appendScript(options);
        }
        script.appendScript(");");
        ScriptSessions.addScript(script);
    }
View Full Code Here

     * @param function The script.aculo.us effect to employ
     * @param options A string containing options to pass to the script.aculo.us effect, as specified at http://script.aculo.us/
     */
    private void callEffect(String elementId, String function, String options)
    {
        ScriptBuffer script = new ScriptBuffer();
        script.appendScript("new Effect.").appendScript(function).appendScript("('").appendScript(elementId).appendScript("'");
        if (options != null && options.length() > 0)
        {
            script.appendScript(", ").appendScript(options);
        }
        script.appendScript(");");
        addScript(script);
    }
View Full Code Here

        // synchronized collections can throw exceptions when being iterated through without manual synchronization.
        synchronized (this.scripts)
        {
            for (Iterator<ScriptBuffer> it = scripts.iterator(); it.hasNext();)
            {
                ScriptBuffer script = it.next();

                try
                {
                    if (conduit.addScript(script))
                    {
View Full Code Here

            try
            {
                if (json)
                {
                    ScriptBuffer buffy = new ScriptBuffer();
                    buffy.appendData(value);
                    pageContext.getOut().write(ScriptBufferUtil.createOutput(buffy, converterManager, true));
                }
                else
                {
                    ScriptBuffer buffy = new ScriptBuffer();
                    buffy.appendScript("return ").appendData(value).appendScript(";");

                    // wrap in a closure so that we don't pollute the javascript namespace with loads of variables
                    pageContext.getOut().write(
                        "(function() { " +
                            ScriptBufferUtil.createOutput(buffy, converterManager, false) +
View Full Code Here

TOP

Related Classes of org.directwebremoting.ScriptBuffer

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.