On Mon, Mar 31, 2008 at 5:29 PM, kanugula <[EMAIL PROTECTED]> wrote:
>
>  Hello,
>
>  I need to access exc.class in Rpc.js to format a proper error message.
>
>  Since 'class' is a reserved word, it throws me the following error.
>  treegenerator.SyntaxException: Expected identifier but found
>  reserved/FUTURE_RES
>  ERVED_WORD: 'class'. file:MyRemoteTableModel, line:144, column:44
>  make[1]: *** [exec-script-source] Error 1
>  make: *** [source] Error 2
>
>  MyRemoteTableModel.js
>  =================
>  var rpc = new qx.io.remote.Rpc(this.getServiceUrl(), "MyRpcService");
>  rpc.setTimeout(10000);
>
>  var handler = function(result, exc) {
>    if (exc == null) {
>         that.reloadData();
>     }
>     else
>     {
>         //alert("Exception from the server: "+exc);
>         fdm.dialog.StatusDialog.show(exc.class != undefined? exc.class :
>  exc, false);
>     }
>  };
>  rpc.callAsync(handler, method, data);
>
>
>
>  Is there an alternate way to access it other than from exc.message?.
>

This is actually a generic javascript question.  If you want to use a
reserved word as a member name in an object, you can use the "array
reference" access method.  In your case, you'd access exc["class"]
instead of exc.class.

Derrell

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to