Re: [xwt-users] Passing arrays in xmlrpc calls
Brian Alliet <[email protected]>
| Newsgroups | gmane.comp.java.xwt.users |
|---|---|
| Message-ID | <[email protected]> |
On Monday, August 4, 2003, at 08:03 AM, Tom Bogaert wrote:
> Is it possible to pass arrays in xmlrpc calls from within xwt ?
certainly
> var a = {} ;
> a[0]=1.0 ;
> a[1]=1.0 ;
> a[2]=1.0 ;
> a[3]=1.0 ;
The "{ }" syntax is used for objects, not arrays. If you want to make
"a" an array use "[ ]";
ex:
var a = [];
a[0] = 1.0;
...
or
var a = [ 1.0, 1.0, 2.0, 3.0 ];
You were trying to pass an object. Your code would have actually worked
(at the XWT end) on nitrogen. The old js engine had some problems with
using non-strings as keys in an array.
> catch(error)
> {
>
> $output.text=$output.text+"\n"+error.faultString;
> }
XMLRPC errors don't currently throw JS exceptions so this code doesn't
do much. It doesn't hurt though, and its probably a good idea to keep
it because XMLRPC errors will throw exceptions *real soon now*.
-Brian