rpc-javarpc-$8.lzx
<canvas debug="true" height="300" width="100%">
<security>
<allow>
<pattern>^examples\.TypesExample</pattern>
</allow>
</security>
<javarpc name="types_example_rpc" scope="none" remoteclassname="examples.TypesExample">
<handler name="onload">
// Set buttons visible only after JavaRPC object loads
canvas.buttons.setAttribute('visible', true);
</handler>
<handler name="ondata" args="res">
Debug.debug('(types ondata) response is: %w', res);
</handler>
<handler name="onerror" args="errmsg">
Debug.debug('(types onerror) error: %w', errmsg);
</handler>
<remotecall funcname="passInteger">
<param value="42"/>
</remotecall>
<remotecall name="pd1" funcname="passDouble">
<param value="42.1"/>
</remotecall>
<remotecall name="pd2" funcname="passDouble">
<param value="42.0"/>
</remotecall>
<remotecall name="pd3" funcname="passDouble">
<param>
<method name="getValue">
return new LzRPC.DoubleWrapper(42.0);
</method>
</param>
</remotecall>
</javarpc>
<view name="buttons" visible="false" layout="spacing: 10">
<button text="pass integer" onclick="types_example_rpc.passInteger.invoke()"/>
<button text="pass double" onclick="types_example_rpc.pd1.invoke()"/>
<button text="pass double (will fail)" onclick="types_example_rpc.pd2.invoke()"/>
<button text="pass double w/LzRPC.DoubleWrapper" onclick="types_example_rpc.pd3.invoke()"/>
<button text="pass boolean" onclick="this.passBoolean.invoke()">
<remotecall funcname="passBoolean" remotecontext="$once{ types_example_rpc }">
<param value="true"/>
</remotecall>
</button>
<button text="pass array" onclick="this.passArray.invoke()">
<remotecall name="passArray" funcname="passClientArray" remotecontext="$once{ types_example_rpc }">
<param value="[1, 'a string', 4.5, false]"/>
</remotecall>
</button>
<button text="pass hash" onclick="this.passObject.invoke()">
<remotecall name="passObject" funcname="passClientObject" remotecontext="$once{ types_example_rpc }">
<param value="{ a: 1, b: 3.14159, c: 'a string value', d: true}">
</param>
</remotecall>
</button>
</view>
</canvas>
Cross References
Named Instances