Speeding up initial page load time with static HTML in a multi form application
Hello all, A while ago we had to work on a GWT application with the requirement that the initial page should be visible in under 1 sec, but since it was a single module, multi form application this requirement would hold for all forms. We initially solved this by having all form markup in the initial page HTML, showing and hiding forms with CSS according to the current history token. But this created a second problem when a history token was included in the initial URL: the browser would first load the HTML showing the initial form and only switch to the correct form once the javascript was loaded. We then solved this flash of content with a short inline javascript that would parse the history token and globally modify CSS so that the right form would show up even before the corresponding HTML was loaded. If you are interested you can read the details here [1] [1] http://georgovassilis.blogspot.com/2012/03/speeding-up-initial-page-view-of-ajax.html -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/lfRRx2IiTjEJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: GWT Dev plug-in for Firefox 11
Thanks Alen, Once again you've come through with the goods. Cheers, Jason ;) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: attempting to understand PlaceTokenizerP
Thanks, Thomas. I had read this before, but it hadn't clicked with me. I see now that MyPlace.Tokenizer.getPlace() is called on the back and forward arrows. After much re-reading, I believe that I've been over-thinking this. There doesn't seem to be any place in my current app where getToken() and getPlace() need to do anything more complex than acting on the token--just return or create a new place with it, no parsing, no rebuilding necessary. I'm trying to imagine doing something else, and I don't see it. However, I suppose it's possible to fool the history by altering the token such that the back button takes you somewhere else entirely. Is this correct? On Saturday, March 24, 2012 6:22:43 AM UTC-4, Thomas Broyer wrote: Have a look there: http://tbroyer.posterous.com/gwt-21-places-part-iihttp://tbroyer.posterous.com/gwt-21-places-part-ii On Thursday, March 22, 2012 6:04:52 PM UTC+1, Thad wrote: I am trying to understand Places, PlaceTokenizer, and how and when to parse the token. I read about them, look at examples, watch there execution, and still I think I'm missing something. (The examples I follow seem not to fit me--they seem either trivial or too complex to follow.) I have a Place, MyPlace. It may get a null token, or it may get a token with one or more items--state, id, etc. Examples would be LIST or SHOW_ID;1234. I read from Thomas that parsing should be done in a PlaceTokenizer ( https://groups.google.com/d/msg/google-web-toolkit/M5jCI-_95mQ/JJcClisInRoJhttps://groups.google.com/d/msg/google-web-toolkit/M5jCI-_95mQ/JJcClisInRoJ). However if when I do my parsing in MyPlace.Tokenizer.getToken(), the MyPlace that is passed to MyActivity contains the previous values for state and id. My trace looks like instantiate MyPlace(LIST) AppActivityMapper.getActivity(): com.foo.bar.client.place.MyPlace@be4139 instantiate MyActivity, place: com.foo.bar.client.place.MyPlace@be4139 starting MyActivity MyView presenter set It seems that the instantiation method for MyPlace must parse the token or calls to place.getState() and place.getId() will return values no yet set. I can see MyPlace.Tokenizer.getToken() being called--though I'm not sure from where--but place.getState() does not return an updated value unless in start() wait with Scheduler.get().scheduleDeferred() and test the value in execute(). I never see MyPlace.Tokenizer.getPlace() called. What is it used for? *WHEN* is it used (never from what I see). Currently I'm parsing the token in MyPlace's instantiation method, but it doesn't feel right. Can anyone clarify this for me? -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/AmJ2qscr2RgJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: getUrl does not return image.
Why are you checking for the image this way? If you're using a ClientBundle, *getUrl()* might be returning a data url, which would be correct, but fail your test here. Try printing out via GWT.log() the actual URL used and letting us know what that is. Sincerely, Joseph -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/qi8IIj-tDucJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: how to change default GWT TEXTBOX Border color
Try overriding the existing property with the *important* keyword. .gwt-TextBox:focus { border: 1px solid #FF *!important*; } Sincerely, Joseph -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/FzqSnEonwicJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: schedule an action for next idle time???
Am Samstag, 24. März 2012 12:01:54 UTC+1 schrieb Thomas Broyer: For GWT-RPC, you can use a RpcRequestBuilder. Hi Thomas, thank you! Can you give a link to a tutorial/documentation on how to do this? I can only find the API docs, but these are not self-explanatory... Magnus -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/HvssTaRMfdEJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Problem to compile to javascript...
I understood what you were trying to do and in many cases I applaud the idea. But I was also curious as to which link you suggesting since I've had a few issues like this but I use Maven. And I hadn't even considered the fact that our browsing history would also affect what we were shown. Thanks for the link (and I guess we should assume he's found a solution to his problem since we seem to be the only ones talking here). -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Can't pass data using JsonpRequestBuilder
Greetings, I have a GWT app talking to a Java servlet just fine except I can't seem to pass data. I've already spent a day on it. Any help would be greatly appreciated. I am using JsonpRequestBuilder and attempting to get around SOP. Here is my server code: public class GWTServlet extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String callback = request.getParameter(callback); PrintWriter out = response.getWriter(); try { out.print(callback + ([{\Hello\: \world\}]);); } finally { out.close(); } } Here is my GWT code: public void onClick(ClickEvent event) { JsonpRequestBuilder jsonprb= new JsonpRequestBuilder(); jsonprb.requestObject(http://localhost:8084/XXX/GWTServlet;, new AsyncCallback() { @Override public void onFailure(Throwable caught) { Window.alert(Failure getting JSONP directly from remote server); } @Override public void onSuccess(Object result) { Window.alert(Got response); JavaScriptObject res = (JavaScriptObject) result; Window.alert(res.toSource()); } }); I get the Got response message. I am also able to put break points on the frontend or backend and it gets to where I expect. The problem is that I can't seem to get at the data send from the server. I don't know what to do in onSuccess(). Of course, once I get this working I will have the same challenge going the other way. Help is greatly appreciated. Blake McBride -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: [gwt-contrib] Mavenizing GWT
On Saturday, March 17, 2012 4:26:01 AM UTC+1, Ray Cromwell wrote: I agree with most of this, but I just wanted to mention that I think breaking up the dependency chain will be a little tricky for maven when it comes to tests. Maven general practice is that a given module contains its tests and runs them. The problem with gwt-dev and gwt-user is that many of the gwt-user tests can't run unless gwt-dev has been built, but gwt-dev IIRC has some tests that depend on gwt-user. So it may be that you need to make separate gwt-dev-tests/gwt-user-tests subprojects. I've started working on the mavenization, but haven't yet come to tests, as simply breaking up dev-ext is not as easy as it sounds! First, third-party dependencies: - ECJ/JDT 3.4.2 is not available as a Maven dependency; maybe it's time to update to a newer version? See http://code.google.com/p/google-web-toolkit/issues/detail?id=3823 and http://code.google.com/p/google-web-toolkit/issues/detail?id=6960 - ICU4J 4.4.2 is not available as a Maven dependency. - sourcemap is a subset of the closure compiler; it would be great to have a proper artifact that closure-compiler would depend on. - streamhtmlparser is a subset of jsilver. - sourcemap, closure-compiler, guava, protobuf and streamhtmlparser have been rebased, so they would have to be either published as com.google.gwt.* Maven artifacts, or possibly jarjar'd as part of the build (as Guice does for ASM, CGLib, Guava and JSR305). I think I'd prefer the latest, as it makes it easier to upgrade to a newer version of the dependency, but it might not work for all of them (e.g. streamhtmlparser) - There are also forked dependencies: Rhino JS parser, to support JSNI references, and ASM (AFAICT because until ASM 4.0 they didn't provide binary compatibility and there were conflicts with third-party libs –possibly EMMA?–, see http://code.google.com/p/google-web-toolkit/source/detail?r=1962). ASM is not really a fork, and Scott suggested that it had been included into GWT because JarJar wasn't yet used at the time http://gwt-code-reviews.appspot.com/699802 It's been modified a bit since then, but only to fix bugs that I believe (but haven't checked) have been fixed upstream. Now that ASM 4.0 provides binary compatibility (under some conditions), it could be used instead, or we could simply use ASM as a third-party dependency and bundle it with JarJar at build-time (see above). Next, dependencies within the code: - most primary linkers in com.google.gwt.core.linker (which I'd likely have bundled in dev-ext) make use of JsToStringGenerationVisitor.javaScriptString. It's easy enough to move the method to com.google.gwt.util.tools.shared.StringUtils to break the dependency between dev-ext and the compiler internals. The JavaScriptStringTest makes use of com.google.gwt.dev.js.rhino.TokenStream though, so I made a rhino-parser-with-jsni artifact out of com.google.gwt.dev.js.rhino, used as a scope=test dependency by dev-ext. - there are classes in com.google.gwt.core.ext that depend on compiler internals (linker/impl/Standard*, linker/*MetricsArtifact and soyc/**), so they should rather be in gwt-dev than in dev-ext. It would be a breaking change to move them into other packages, so I suggest we just split the package in the two JARs. I'd like SelectionScriptLinker to be part of dev-ext, so excluding c.g.g.core/ext/linker/impl/** is not really an option. - there are a few dependencies from com.google.gwt.core.linker to com.google.gwt.util (but not util.tools.shared) and com.google.gwt.dev.util; again that might break too many people moving classes around. - GeneratorContext references ResourceOracle, so there's some tweaking to do in inclusion patterns yet again. - There are also dependencies from RequestFactory to ASM, but only for 2 classes (Type and Method) and for methods that don't even use ASM bytecode processing. I've started simplifying the code to remove the dependency. I'm still in the very early stage (dev-ext doesn't even compile yet, so basically I only have common and rhino-parser-with-jsni passing), and I haven't yet looked at the tests dependencies you were talking about. Personally, I'd like to break up GWT-user further into lots tiny pieces, like Core, I/O, Emulation, RPC, Widgets, DOM/Media/HTML, etc We can still build an uber gwt-user.jar, but there are lots of projects that don't use everything, and being able to move stuff off of the classpath speeds up the compiler and dev-mode. There are some projects like PlayN for example, that pretty much only use Core. Agreed, but I'll postpone that until I have something working ;-) -- http://groups.google.com/group/Google-Web-Toolkit-Contributors