rpc-javarpc-$2.lzx

<canvas debug="true" width="100%">

    <!-- The security describes what classes are accessible or are allowed to be
         instantiated in the server. See the security section in this chapter
         for more information. -->
    <security>
        <allow>
            <pattern>^examples\.ConstructExample</pattern>
        </allow>
    </security>

    <!-- See $LPS_HOME/WEB-INF/classes/ConstructExample.java for java
        source. -->
    <javarpc name="ce" scope="session" autoload="false" remoteclassname="examples.ConstructExample" createargs="[1, 'a string', 1.45]">

        <handler name="onerror" args="err">
            Debug.debug("----------");
            Debug.debug("onerror: %w", err)
        </handler>

        <handler name="onload">
            Debug.debug("----------");
            Debug.debug("constructed with %w", this.createargs);
            Debug.debug("%w", this.proxy);
        </handler>

    </javarpc>
    
    <simplelayout inset="10" spacing="5"/>

    <button x="10" text="construct">
        <handler name="onclick">
            canvas.ce.load();
        </handler>
    </button>

    <button x="10" text="getinfo">
        <handler name="onclick">
            this.getInfo.invoke();
        </handler>

        <remotecall funcname="getInfo" remotecontext="$once{canvas.ce}">
            <handler name="ondata" args="res">
                Debug.debug("----------");
                Debug.debug("method: %w", this.name)
                Debug.debug("return type: %w", typeof(res))
                Debug.debug("return value: %w", res);
            </handler>
        </remotecall>
    </button>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2007, 2008 Laszlo Systems, Inc.  All Rights Reserved.                   *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->

Cross References

Named Instances