PDA

View Full Version : gwt-1.2.3 RootPanel.get("main").remove(viewport_instance)



Shawn.in.Tokyo
21 Feb 2009, 4:49 AM
I can't run hosted mode under gwt-1.2.3 as I get an inexplicable error, a really really inexplicable error. It works fine under 1.2.2.

At one point in my code, I access a static variable. Fine. A moment later I use the same getter method to access it again and get a null value erroneously returned.

There is nothing in my code that could be setting the value to null. Again it works under 1.2.2. It's just whack.


java.lang.NullPointerException
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at com.google.gwt.user.client.Timer.clearTimeout(Timer.java)
at com.google.gwt.user.client.Timer.cancel(Timer.java:93)
at com.google.gwt.user.client.Timer.schedule(Timer.java:114)
at com.google.gwt.user.client.CommandExecutor.maybeStartExecutionTimer(CommandExecutor.java:355)
at com.google.gwt.user.client.CommandExecutor.submit(CommandExecutor.java:230)
at com.google.gwt.user.client.DeferredCommand.addCommand(DeferredCommand.java:57)


I did notice a very odd thing that if I comment out the following code to clear a Viewport from the RootPanel that immediatly precedes my getter call, my unrelated getter call works as it should:

//try{
//RootPanel.get("main").remove(auto_resize);// auto_resize is a Viewport
// }catch(Exception e) {
// Log.info(e.getMessage());
// }catch(Error e) {
// Log.info(e.getMessage());
// }

But if there were an error, why doesn't the try catch clause contain it? Am I not catching correctly?

There is no way my getter can be returning null. Actually, the getting is throwing the strange error above. Why does removing a Viewport from the RootPanel cause an unrelated static to be unaccesable?

Shawn

sven
21 Feb 2009, 4:57 AM
A viewport was never made to be removable, but we already reverted the change made to viewport in SVN.

Shawn.in.Tokyo
21 Feb 2009, 6:27 AM
What else, if I may ask, isn't designed to be removed?

Anyway, thanks for your response.

All the Best,

Shawn

sven
21 Feb 2009, 6:31 AM
Well isnt designed is maybe the wrong word. Wasnt thought about make it better. 1.2.4 will make it work.