Re: JSONP: Overlays with Optional Attributes (HostedModeException's), How?

2010-08-03 Thread Andrew Hughes
Fixed... but I think this stinks :) public final Double getXMin(){ return isXMinNull() ? null : getXMinValue(); } private final native boolean isXMinNull()/*-{ return this.xmin == null; }-*/; private final native double getXMinValue()/*-{ return

Re: JSONP: Overlays with Optional Attributes (HostedModeException's), How?

2010-08-03 Thread André Moraes
At least this is private, so nobody will see the hack (except you) :) -- André Moraes Analista de Desenvolvimento de Sistemas andr...@gmail.com http://andredevchannel.blogspot.com/ -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post

Re: JSONP: Overlays with Optional Attributes (HostedModeException's), How?

2010-08-03 Thread lineman78
Reported in Feb, still listed as new, so make sure you vote: http://code.google.com/p/google-web-toolkit/issues/detail?id=4646 On Aug 3, 1:07 am, Andrew Hughes ahhug...@gmail.com wrote: Fixed... but I think this stinks :)     public final Double getXMin(){         return isXMinNull() ? null

JSONP: Overlays with Optional Attributes (HostedModeException's), How?

2010-08-02 Thread Andrew Hughes
I'm attempting to perform JSONP (cross domain ajax), just like in this great article (thanks) http://eggsylife.co.uk/2010/04/22/gwt-2-jsonp-and-javascript-overlays-with-jsonprequestbuilder/ The json response has optional attributes, it could be... {error: yay} or {response: 53} The

Re: JSONP: Overlays with Optional Attributes (HostedModeException's), How?

2010-08-02 Thread André Moraes
I had almost the same problem, what I did was: Added a function that return true if the error is set, false otherwise: public final native boolean hasError() /*-{ if (this.error) return true; else return false; }-*/; The i first check if hasError is true, if it is i throw an Exception in my

Re: JSONP: Overlays with Optional Attributes (HostedModeException's), How?

2010-08-02 Thread Andrew Hughes
Thanks André, Indeed, you are correct that Production Mode can detect a problem when attempting to parse out a null value. This I already knew :) The problem lies a little deeper... Hopefully others can help me with this plase :) 1) This HostedModeException is very annoying. Null (or in

Re: JSONP: Overlays with Optional Attributes (HostedModeException's), How?

2010-08-02 Thread André Moraes
1) This HostedModeException is very annoying. Null (or in JavaScript terms 'undefined') is a valid value for my JavaScript/JSON attributes. I want a way where if the darn thing is undefined return null... don't throw a HostedModeException - I also tried in jsni if(this.attribute){ return

Re: JSONP: Overlays with Optional Attributes (HostedModeException's), How?

2010-08-02 Thread Andrew Hughes
Thank's again André :) I've made some progress. you'r suggestion to use Integer and not primitive int was bang on the mark! :) Unfornately autoboxing was masking some of my problems - but now I have learnt the error's of my ways :) Now I am happily using Integer with and without null