Thursday, July 3, 2014

Re: JSNI function and DevMode

I've been able to get largely past this issue.  It looks like the menus aren't working because of an issue with how the Controllers are loaded in DevMode (still researching).  The JS method gets exported and is properly firing the selected page, but that event is getting lost further along.

The part that was throwing me off is that in DevMode, when I have the JS function defined as in the first post, clicking on a menu and firing this function causes the page to clear and "null" to be displayed.  If I remove the $entry(); wrapping, the method still fires, but doesn't cause DevMode to clear the page and display "null".

Thanks for everyone's suggestions.


On Thursday, July 3, 2014 12:19:31 PM UTC-4, jonl wrote:
After reading the other replies and looking at this, I would suspect it to be a race condition in DevMode.  Where the problem lies in when the exportMenuClickedMethod() is called.  

This is where the method being static or not comes into play.  By it not being static, it can't be called until an instance of the class is created, which in DevMode may different than in compiled mode because you have the back and forth of the browser and Eclipse here.

So, I would make the method static, and call it in a static initialize block for the class in which it is declared.  That way it will be exported more consistently in DevMode and compiled mode.


On Wednesday, July 2, 2014 10:33:33 AM UTC-7, gktcs wrote:
I was trying to "anonymize" what was actually being done when pasting in here and somehow ended up with an extra single quote.  I've verified that the application is correct and just using 'PAGE'.

As for the export function not being static...probably just an oversight.  I wouldn't think it matters either, but I'll make the change and see if that makes any difference.

On Wednesday, July 2, 2014 11:59:47 AM UTC-4, Patrick Tucker wrote:
You have 2 single quotes after PAGE??

Also, not that it should matter here, but why isn't your export function static?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment