Re: GWT very slow on IE
Above all, are you sure you're not running hosted mode? That'll slow things down significantly. On Fri, Jun 11, 2010 at 11:56 AM, Prema Monica premamon...@gmail.comwrote: How many RPC calls do you have on this page? How is the performance on the other browsers? I believe IE 6 and 7 permit only 2 simultaneous requests. though IE8 permits 6. check out the link below for more details. http://stackoverflow.com/questions/561046/how-many-concurrent-ajax-xmlhttprequest-requests-are-allowed-in-popular-browser The correct approach would to first identify whether it is the server code or the client code which is causing the poor performance. most probably it should be the server code, you can check with firebug the time consumed for each RPC and then dig into the call which is consuming the maximum time. On Thu, Jun 10, 2010 at 1:20 PM, vinod vinodk...@yahoo.com wrote: Hi My GWT application takes 10 seconds on IE with GWT . without GWT it used to take less than second. 10 times slower with GWT. We are using GWT for first time in our application. And the app is very slow on IE. Business is very unhappy with performance. Can you please help me to bring this performance down to 1 sec. Thanks Regards Vinod -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@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: calling rest service from GWT
Browsers support XML, but unfortunately there's no API exposing that. Google provides the XML parser http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/index.html?overview-summary.html You may have to write your own code to generate that request. On Thu, Jun 10, 2010 at 12:12 AM, PEZ p...@pezius.com wrote: On Jun 9, 11:36 pm, Sripathi Krishnan sripathi.krish...@gmail.com wrote: This has some disadvantages - authentication cookies meant for external domain will not be sent by the browser. What does that mean in practice? /PEZ -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@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: Does entire IncrementalCommand run in one tick?
No, it cannot creep. Each execute callback runs as 1 uninterrupted thread. On Wed, Jun 9, 2010 at 4:25 PM, macagain rgk...@gmail.com wrote: Do all steps of an IncrementalCommand run in one tick, or does it return control to the js event loop in between steps, thereby allowing other commands on the deferred queue to run in between steps? e.g. List results = some list returned from a service; DeferredCommand.addCommand(new IncrementalCommand() { int i=0; public boolean execute { doSomeReallyLongAssWorkWithRecord(results.get(i++)); updateUI(); return iresults.size(); } }); DeferredCommand.addCommand(new Command() { public void execute() { doCleanUp(); } }); i.e. will the 2nd deferred cmd (i.e. the cleanup step) always only run after the incremental command is done, or can it creep in between steps of the incremental command? Thanks much for replies! -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@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: Suggestions for dealing with Timers
The way I would do it would be: Timer t = new Timer() { public void run() { // do one pass of the sort } }; // Schedule the timer to run once in 5 seconds. t.schedule(interval); where interval is how frequently you wish to animate. Remeber - javascript is single threaded. There is no sleep mechanism. On Mon, Feb 1, 2010 at 9:53 AM, Sean slough...@gmail.com wrote: Im trying to do a visual sort. Imagine a bubble sort where you see the items move from one bucket to the next. The way I would move them visually is use a Timer with an AbsolutePanel and move them up. However, I wouldn't want to move the next guy until my last one has finished animating. If I do that, then everything will animate at once making a big mess that ends up correct, but you can't see the process happening clearly. What I would want is, on the timer finishing, I'd like to do a CallBack and say, I'm done, u can do the next one. What's the correct way to handle this? a While(Timer!=null){sleep} type thing or somehow fake an AsyncCallback or some other way? Thanks in advance for your suggestions! -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@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: Suggestions for dealing with Timers
So you would obviously have to change it. Incremental command wouldn't help you since you are doing animation Incremental commands are just a way of allowing long-running data processes to maintain an interactive UI - otherwise the UI would block while you did your processing. Thus they don't help you here since you cannot control the interval. MyBinClass [] unsortedBins; int interval = 1000; new Timer() { private final MyBinClass [] bins = unsortedBins; private int bin = 0; public void run() { if (bin = bins.length) { return; } moveBinToCorrectSpot(bins[bin]); bin++; schedule(interval); // schedule the next step to run a second after this one } }).schedule(0); // start the animation now. This way, you can even adjust the sort interval between each step (if you want to speed up during the animation or allow control by a slider). Also, I'd take a look at the Animation class as well which might help you with saying this animation must complete in 10 seconds, and base your calculations of the progress (since computer speed is variable) On Mon, Feb 1, 2010 at 11:37 AM, Sean slough...@gmail.com wrote: Hi Vitali, That is what I'm doing now. However, I'm going to have something like //For example for(bin : bins) { moveBinToCorrectSpot(bin) } So each Bin will get it's own timer in moveBinToCorrectSpot that moves it to it's right spot. However, they'll all animate at the same time. Jeff, I will have to check out IncrementalCommand, I've never seen that before. Thanks for the tips all! On Feb 1, 12:53 pm, Sean slough...@gmail.com wrote: Im trying to do a visual sort. Imagine a bubble sort where you see the items move from one bucket to the next. The way I would move them visually is use a Timer with an AbsolutePanel and move them up. However, I wouldn't want to move the next guy until my last one has finished animating. If I do that, then everything will animate at once making a big mess that ends up correct, but you can't see the process happening clearly. What I would want is, on the timer finishing, I'd like to do a CallBack and say, I'm done, u can do the next one. What's the correct way to handle this? a While(Timer!=null){sleep} type thing or somehow fake an AsyncCallback or some other way? Thanks in advance for your suggestions! -- 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- 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-tool...@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: RPC facade for load time optimizing?
I found it worked well to have a wrapper around GWT.create that would simply return a on-first-use created singleton. Thus start-up time is much shorter, the cost of creating services in hosted mode is ammortized of the usage of the app, and the penalty is only payed the first time you create the instance. The singleton trick below is for the hosted mode - the class loader will actually only on first use. In web-mode, it should all be inlined with no overhead. For example: public class ServiceFactory { private class MyAmazingServiceAsyncWrapper { static final MyAmazingServiceAsync instance = GWT.create(MyAmazingServiceAsync.class) } MyAmazingServiceAsync getMyAmazingService() { return MyAmazingServiceAsyncWrapper.instance; } } I wouldn't recommend merging RPC calls into fewer of them just to make hosted mode faster. I think you'll find several problems with that approach: Maintaining the dispatch code on the server, the compiler can't be as efficient (I think if you merge a lot of calls together like this, the RPC will actually be much more bloated since it won't know the types that can be going over the wire). Also, maintaining the code will be tricky. On Sat, Oct 31, 2009 at 10:14 AM, fker...@gmail.com fker...@gmail.comwrote: Googling around, I just found a post from a couple of years ago, which suggested (see #1 Reduce the number of remote services at the link below) using a facade for multiple RPC, in order to drive startup time down... has anybody tried this? Does it still make sense? http://robvanmaris.jteam.nl/2007/11/30/optimizing-startup-time-for-gwt-hosted-mode/ --~--~-~--~~~---~--~~ 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: RPC facade for load time optimizing?
Sorry - I misread what he was doing. The downsides I mentioned aren't applicable. It might be an interesting approach - it would be interesting to hear the effect this has on optimization. On Sat, Oct 31, 2009 at 1:04 PM, Vitali Lovich vlov...@gmail.com wrote: I found it worked well to have a wrapper around GWT.create that would simply return a on-first-use created singleton. Thus start-up time is much shorter, the cost of creating services in hosted mode is ammortized of the usage of the app, and the penalty is only payed the first time you create the instance. The singleton trick below is for the hosted mode - the class loader will actually only on first use. In web-mode, it should all be inlined with no overhead. For example: public class ServiceFactory { private class MyAmazingServiceAsyncWrapper { static final MyAmazingServiceAsync instance = GWT.create(MyAmazingServiceAsync.class) } MyAmazingServiceAsync getMyAmazingService() { return MyAmazingServiceAsyncWrapper.instance; } } I wouldn't recommend merging RPC calls into fewer of them just to make hosted mode faster. I think you'll find several problems with that approach: Maintaining the dispatch code on the server, the compiler can't be as efficient (I think if you merge a lot of calls together like this, the RPC will actually be much more bloated since it won't know the types that can be going over the wire). Also, maintaining the code will be tricky. On Sat, Oct 31, 2009 at 10:14 AM, fker...@gmail.com fker...@gmail.comwrote: Googling around, I just found a post from a couple of years ago, which suggested (see #1 Reduce the number of remote services at the link below) using a facade for multiple RPC, in order to drive startup time down... has anybody tried this? Does it still make sense? http://robvanmaris.jteam.nl/2007/11/30/optimizing-startup-time-for-gwt-hosted-mode/ --~--~-~--~~~---~--~~ 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 RPC Encryption
On Fri, May 29, 2009 at 3:29 AM, Deep Blue deep.blue...@gmail.com wrote: Hi all, Is it possible to create an encyption / decryption layer around GWT rpc mechanism? The problem is currently in GWT rpc, all the data are sent / received from server in JSON text (although SSL can help protect middle-man attack, but launching firefox with firebug can see all the post data in clear text). SSL is fine. What your thinking of is impossible ( it's why there's no such thing as fool-proof DRM). You're trying to have Alice send a secret message to Bob while keeping that message secret from Alice. Anyone got any idea how to create a layer to encrypt the data in server side (after the serialization), and decrypt it in client side (before the deserialization)? You could always supply the server's RSA public key to have the serializer encrypt the data with that prior to sending, but I don't see the purpose since the user can still use firebug to put a breakpoint in the serializer code to read the data before-hand. You're just making your life more difficult complicated without reason. I know it can't totally prevent the user from decrypting (since the decryption logic is sent to user's pc as javascript), but it is better than expose the data in clear text just using firebug plugin. I think you need to learn how asymmetric encryption works. Just because you have the algorithm encryption key doesn't mean you can decrypt the data. If you're thinking of the symmetric encryption (i.e. AES), then yes, algorithm + encryption key is enough to decrypt. Thanks! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[gwt-contrib] Re: Feature idea - reference Java methods as Javascript functions
On Fri, May 29, 2009 at 9:42 AM, John Tamplin j...@google.com wrote: On Thu, May 28, 2009 at 8:18 PM, Vitali Lovich vlov...@gmail.com wrote: It would be nice if there was a way to wrap Java methods with an opaque Javascript function object so that you could pass them around in the native code (obviously there are issues with compiler optimizations in this case). You can do this now -- in a JSNI method: static void bar(int arg) { ... } var f = @org.example.Foo::bar(I); I was thinking more along the lines of JavascriptFunction foo = MyClass.bar.method or something like that. That way, you could do dynamic function invocation without ever needing JSNI. It's also a lot easier to write that code, maintain it, it's IDE friendly, meaning no typos syntax checking (which is a major strength of GWT). You can then pass/return it to Java/JSNI code as a JavaScriptObject, or directly to external Javascript that looks for a function. Ideally, you would be also able to execute any Javascript function object from within Java code, although that does present some problems. You have to have a JSNI method to do this now: private static native JavaScriptObject callFunc(JavaScriptObject func, int arg) /*-{ func(arg); }-*/; Yes - hence the feature request. I know it's non-trivial given that GWT follows Java convention wraps varargs in an array which could cause problems for the JS. Just trying to get some feedback on whether or not it's a good idea. -- John A. Tamplin Software Engineer (GWT), Google --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Feature idea - reference Java methods as Javascript functions
On Fri, May 29, 2009 at 11:59 AM, John Tamplin j...@google.com wrote: On Fri, May 29, 2009 at 11:31 AM, Vitali Lovich vlov...@gmail.com wrote: The way you get a method reference in pure Java is via reflection, which in general is not feasible though there have been some discussions of allowing it when everything can be evaluated at compile time (ie, all constants for classes and method/field names) -- even that seems to be a long way away however. How about through GWT.create? Then it uses reflection to supply the actual function. Might be limited to JSNI functions unless you can compile code fragments. GWT.create takes a single class literal, so there is no way to describe a method. You could have it generate an object with a callback function, but that is going to be a lot more boilerplate than just having a simple JSNI method that returns the torn-off function. Not necessarily GWT.create - just something along those lines that provides enough static information for it to resolve the method yet also provide compile-time checking for that. I'm still thinking about it - it is difficult to think of a clean way of doing it (without the boilerplate code as you mentioned) since overloading is what causes problems. I haven't actually looked at the plugin yet. If you are worried about JSNI syntax or autocompletion, you really should. You also get a Deploy to Google button for AppEngine integration. I'm not actually - it would just be nice to not have to drop into JSNI for something that is seemingly so simple. Why not create a JsFunction class that extends from JavaScriptObject to represent a JS lambda function. However, since you can't have polymorphic dispatch on JSOs, that would reserve whatever name was chosen from all subclasses, so it would have to be something unlikely to collide. I'm not sure what you mean here. Why would you need to reserve a name? Because of how JSOs work (in that you can freely cast them to each other), JSO method calls have to be statically resolvable. If we put a call() method on JavaScriptObject, no other JSO subclass could have a call method with the same signature (and that restriction is enforced by requiring the method or class to be final). However, your suggestion of putting it on a JSO subclass solves that problem. The remaining complication is that you can't declare a JSNI method with varargs, so it is somewhat complicated to build the args list for the call. You would probably also have to have one for void returns and one for calls returning a value (it might be possible to handle that with a return type parameter on JsFunction like JsFunctionInt). Yeah - the varargs is the problem. I was thinking about maybe using eval, but I can't really see how. I concede that there's probably no way to do all this cleanly within the context of GWT (at least not without ugly hacks that break Java syntax). -- John A. Tamplin Software Engineer (GWT), Google --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
Re: IE error can't debug!
That just introduces more problems. 1) Not maintainable - you have to remember to change it every single time you compile. 2) It's a hack. Without understanding the real cause, you are just asking for more problems later on. The problem could resurface elsewhere you won't know why you'll then have multiple places that need editing. 3) The problem is in your code - fix that you won't have problems. If it's a compiler issue (unlikely in this case), then file a bug the GWT engineers will fix it for everyone. PS - just to correct myself from before: on Windows, GWT uses whatever version of IE you have installed. On Thu, May 28, 2009 at 5:48 AM, meng m123...@gmail.com wrote: just edit the compiled script, change if (o.nodeType) { to if (o o.nodeType) { --~--~-~--~~~---~--~~ 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: Tomcat and GWT 1.6
What you came up with was a hack instead of properly configuring your server (I'm 99% confident your mistake was in the web.xml). On Tue, May 26, 2009 at 11:07 AM, Donald.W.Long donald.w.l...@thelongsfamily.com wrote: Yep I am using GWT 1.6 And I came up with a solution that will work on all types of servers does not matter if its tomcat or what ever. I wrote a simple servlet that returns the root URL for your site, and then I add this to the location, works great, no problems with using tomcat or others. package com.cindiescreations.CindiesCreations.server; import javax.servlet.http.HttpServletRequest; import com.cindiescreations.CindiesCreations.client.RootURL; import com.google.gwt.user.server.rpc.RemoteServiceServlet; public class RootURLImpl extends RemoteServiceServlet implements RootURL { private static final long serialVersionUID = 1L; @Override public String getRootURL(String nop) { HttpServletRequest req = getThreadLocalRequest(); String reqUrl = req.getRequestURL().toString(); // TODO: do a scan of the string to make it more usable. reqUrl = reqUrl.substring(0, reqUrl.length()-25); return reqUrl; } } On May 24, 10:21 am, Vitali Lovich vlov...@gmail.com wrote: Have you read what Jamie told you? He gave you a hint - your relative paths are wrong (TamperData or Firebug will tell you what they are), that's all. Either fix your Tomcat config or put the resources where they should be. Or even better, use GWT 1.6 which has a far better deployment strategy. On Sun, May 24, 2009 at 10:41 AM, Donald.W.Long donald.w.l...@thelongsfamily.com wrote: What I have done, is made the URL fully qualified and it works. But seems to me it should work with not being fully qualified. Has anyone ever deployed GWT on tomcat with local html pages loaded via a Frame? Thanks On May 22, 9:51 am, Jamie jamiesharbor-sou...@yahoo.com wrote: I would suggest using Firefox + TamperData. Then you should be able to see what URL the browser is trying to access when you use the relative URL, or if in fact it is sending the request at all. Jamie.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Tomcat and GWT 1.6
Oh I dunno why you are even doing this with 1.6. As of 1.6, RPC interfaces can be annotated so you don't need to screw around with the URLs. On Tue, May 26, 2009 at 12:29 PM, Vitali Lovich vlov...@gmail.com wrote: What you came up with was a hack instead of properly configuring your server (I'm 99% confident your mistake was in the web.xml). On Tue, May 26, 2009 at 11:07 AM, Donald.W.Long donald.w.l...@thelongsfamily.com wrote: Yep I am using GWT 1.6 And I came up with a solution that will work on all types of servers does not matter if its tomcat or what ever. I wrote a simple servlet that returns the root URL for your site, and then I add this to the location, works great, no problems with using tomcat or others. package com.cindiescreations.CindiesCreations.server; import javax.servlet.http.HttpServletRequest; import com.cindiescreations.CindiesCreations.client.RootURL; import com.google.gwt.user.server.rpc.RemoteServiceServlet; public class RootURLImpl extends RemoteServiceServlet implements RootURL { private static final long serialVersionUID = 1L; @Override public String getRootURL(String nop) { HttpServletRequest req = getThreadLocalRequest(); String reqUrl = req.getRequestURL().toString(); // TODO: do a scan of the string to make it more usable. reqUrl = reqUrl.substring(0, reqUrl.length()-25); return reqUrl; } } On May 24, 10:21 am, Vitali Lovich vlov...@gmail.com wrote: Have you read what Jamie told you? He gave you a hint - your relative paths are wrong (TamperData or Firebug will tell you what they are), that's all. Either fix your Tomcat config or put the resources where they should be. Or even better, use GWT 1.6 which has a far better deployment strategy. On Sun, May 24, 2009 at 10:41 AM, Donald.W.Long donald.w.l...@thelongsfamily.com wrote: What I have done, is made the URL fully qualified and it works. But seems to me it should work with not being fully qualified. Has anyone ever deployed GWT on tomcat with local html pages loaded via a Frame? Thanks On May 22, 9:51 am, Jamie jamiesharbor-sou...@yahoo.com wrote: I would suggest using Firefox + TamperData. Then you should be able to see what URL the browser is trying to access when you use the relative URL, or if in fact it is sending the request at all. Jamie.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Tomcat and GWT 1.6
Have you read what Jamie told you? He gave you a hint - your relative paths are wrong (TamperData or Firebug will tell you what they are), that's all. Either fix your Tomcat config or put the resources where they should be. Or even better, use GWT 1.6 which has a far better deployment strategy. On Sun, May 24, 2009 at 10:41 AM, Donald.W.Long donald.w.l...@thelongsfamily.com wrote: What I have done, is made the URL fully qualified and it works. But seems to me it should work with not being fully qualified. Has anyone ever deployed GWT on tomcat with local html pages loaded via a Frame? Thanks On May 22, 9:51 am, Jamie jamiesharbor-sou...@yahoo.com wrote: I would suggest using Firefox + TamperData. Then you should be able to see what URL the browser is trying to access when you use the relative URL, or if in fact it is sending the request at all. Jamie. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[gwt-contrib] Re: Comment on UsingOOPHM in google-web-toolkit
Worked for me. Did you use the XPI or XPCOM one? On Sun, May 24, 2009 at 5:11 PM, codesite-nore...@google.com wrote: Comment by henr...@yahoo.fr: The provided firefox plugin doesn't work for me (Linux x86_64). I had to build a new firefox plugin from SVN. For more information: http://code.google.com/p/google-web-toolkit/wiki/UsingOOPHM --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
Re: Password Encryption
My sentiments exactly. Not to mention that it's actually quite easy, if you don't know what you are doing, and make a secure algorithm unsecure by something as simple as choosing the wrong random number generator ( I imagine the random number generator used in Javascript is actually not suitable). I would always prefer HTTPS over anything I would write because its so reliable and people much smarter than I have verified the particular implementation. On Thu, May 21, 2009 at 11:28 AM, Magius antonio.diaz@gmail.com wrote: Security is a very complex and wide world. It's not the same an application for a blog with basic security that a back application with a very high security at the browser, communication and server levels. Usually it's enough using a hash D Peters said. For enterprises, usually I have to use HTTPS to protect the data interchanged too. All depends on the security level that your app requires. On May 20, 3:26 pm, D Peters logicpet...@gmail.com wrote: Ah.. doing an RSA-type transaction over javascript is tricky, but do- able. But do you really need that level of security? Most web-sites do not do this -- they merely hash the password using one-way encryption (MD5). There are plenty of js libraries to do this, and all you would need to do in GWT is wrap the encode method with a JSNI call. A very simple solution offering a basic level of security (so passwords don't go in clear text over the wire). I'm not saying MD5 hashing on the client is great security. You could intercept the hashed password and do a rainbow attack to find out what the true password is, or hack the application and use the hashed password to imitate the user. It really depends on how secure your site needs to be.. On May 19, 10:15 pm, Mark Renouf mark.ren...@gmail.com wrote: This is a solved issue, there's many approaches. SSL is the easiest but not always needed, or possible (adds latency and scaling problems). We use HmacSHA1 client side with GWT, and find it works well for our needs. HmacSHA1 is simple enough to implement once you get SHA1 working. There's tons of examples out there. I took one that was relatively simple Java sample and adjusted it work with GWT. It goes something like this: 1. Server sends random token to client (called a NONCE or Number used once) 2. Client computes HmacSHA1(token, passoword+timestamp) and sends the resulting signature and the timestamp used back to the server. 3. The server performs the same operation and confirms it's computed signature matches the one returned by the client and that the timestamp is within an acceptable time range. If these conditions are met, the client has proven it has the correct password. You can protect against replay by only allowing a token to be used once from the same IP address it was sent to. You can extend this easily to do more: If you do this on every request, and include the URL, query parameters and key headers in the signature you can secure various web service calls. If you compute the MD5 or SHA1 of the body, and include that in the Hmac signature as well, then you've got a message integrity check on the whole request. If you need to prevent others from seeing the data of the requests at all, then SSL is your only real option. On May 19, 8:10 pm, Vitali Lovich vlov...@gmail.com wrote: First off, good luck trying to disassemble the GWT compiled code - it's hard to read even when you know what the original Java code is doing. Nextly, I don't think I understand the problem you are presenting - it seems to me that if you have a script-injection exploit in your code, there is no way you can code it to protect the user, since the attacking code can always modify the original code in whatever way is necessary to send the password to the attacker. So whether or not you implement the algorithm in Javascript or not is irrelevant. An algorithm is a step-by-step process, independent of the language used to express it. Security is a property of the algorithm/protocol, not the language. Exactly how do you block the get set functions? Also, it's not like those functions are standard, so I'm guessing their your equivalent to the more common foo bar. On Tue, May 19, 2009 at 6:48 PM, Alyxandor a.revolution.ultra.b...@gmail.com wrote: You can't attack the post-RSA password field, but if there's any point along the way that the password is passed inside javascript, it might be possible for a script-injection attacker to overwrite your functions / add getter functions to prototypes and post your password using something like rsa.prototype.set()=function(pass){addHack ( 'script src=badguys.com?x='+pass+'/http://badguys.com?x=%27+pass+%27/ http://badguys.com?x=%27+pass+%27
Re: Password Encryption
On Tue, May 19, 2009 at 9:30 AM, Magius antonio.diaz@gmail.com wrote: If you encrypt the password at the client side, everybody can review the javascript algorithm and break it. That is blatently wrong. If I implement RSA in Javascript, you're telling me you can break it? If you can do that, you can make millions (not only because you could monitor any bank transaction but also because you will have revolutionized the security field). If you establish an HTTPS connection, then the channel is secure and you can transfer the password in clear or with a simple transformation. HTTPS is great for secure communication because it's a protocol that has been vetted by extremely smart people. However, you should always only ever store a hash of the password. To add to that, you can ensure even better security for your users by salting hashing the password client side storing that in a database - that way, at no point in time can an attacker on your system get a clients password (they'd have to attack the client directly). If this is too much work, simply hash the password as soon as you get it on the server side (although this approach also places more load on your server). On May 19, 6:50 am, abhiram abhir...@gmail.com wrote: Hi all, I wanted to know if there are any jars readily available for encryption. I need to encrypt the password and send it across to the server side. Thanks and Regards, Abhiram --~--~-~--~~~---~--~~ 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: Password Encryption
First off, good luck trying to disassemble the GWT compiled code - it's hard to read even when you know what the original Java code is doing. Nextly, I don't think I understand the problem you are presenting - it seems to me that if you have a script-injection exploit in your code, there is no way you can code it to protect the user, since the attacking code can always modify the original code in whatever way is necessary to send the password to the attacker. So whether or not you implement the algorithm in Javascript or not is irrelevant. An algorithm is a step-by-step process, independent of the language used to express it. Security is a property of the algorithm/protocol, not the language. Exactly how do you block the get set functions? Also, it's not like those functions are standard, so I'm guessing their your equivalent to the more common foo bar. On Tue, May 19, 2009 at 6:48 PM, Alyxandor a.revolution.ultra.b...@gmail.com wrote: You can't attack the post-RSA password field, but if there's any point along the way that the password is passed inside javascript, it might be possible for a script-injection attacker to overwrite your functions / add getter functions to prototypes and post your password using something like rsa.prototype.set()=function(pass){addHack ( 'script src=badguys.com?x='+pass+'/http://badguys.com?x=%27+pass+%27/');...} Or such. Of course, you sound like a smart guy who would already override such functions to prevent an attack, but not everybody thinks to manually block get() and set(), so having plain-script authentication would let badguys.com know if it's worth trying or not... --~--~-~--~~~---~--~~ 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: SIGSEGV in Ubuntu java 6 out the Wazoo!
OpenJDK worked fine for me. Also, the newer Sun JDKs work fine too - there's instructionshttp://www.debianhelp.co.uk/debianjava.htmaround on how to convert the Sun package into a debian package. sudo apt-get install java-package fakeroot make-jpkg sun jdk.bin sudo dpkg -i sun-*.deb sudo update-alternatives --config java sudo update-alternatives --config javac On Sat, May 16, 2009 at 11:17 AM, Alyxandor a.revolution.ultra.b...@gmail.com wrote: Hey all, I've been having a slight problem plaguing me of late, and thought to post this solution for anyone else experiencing the same issue. There's already a few bugs filed for variations of this, but they're a little different, on older builds of GWT, so rather than doing +1 on an old bug report, I thought I'd post on a fresh thread here in case anyone searches this forum for the problem. The server is running at http://localhost:7711/ # # An unexpected error has been detected by Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x0625665c, pid=11193, tid=2419309456 # # Java VM: Java HotSpot(TM) Server VM (10.0-b23 mixed mode linux-x86) # Problematic frame: # V [libjvm.so+0x25665c] # # An error report file with more information is saved as: # /home/x/xGwt/xCore/war/hs_err_pid11193.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # look familiar? I'm running Ubuntu 8.04, x686, w/ GWT 1.6.4 and Appengine 1.2.0 {1.2.1 won't upload yet} and I only get this message when I try to run my app under Java 6; it'll go in Java 5, but I used to be running it in 6 and everything was fine. Well, I'd get a SIGSEGV once in a while, but it wasn't too bad. My box is running 4G RAM, eclipse is set to 1G, and I'm running w/ Xmx768M... I tried upping the Xmx, decreasing it, running in ant {through IDE and terminal}, but that does the same thing with java returned 134 at the end. This isn't critical, because I don't use anything in the 1.6 API on the server side, but it WAS frustrating. For extra clarity, this project has just over 500 source files, and I'm using gwtquery + incubator, generic 24-24 headers {only mods are vbox support and rt audio}, eclipse 3.4, 64bit architecture, running 32-bit headers and sun java 1.6.0.7 / 1.5.0.16 {Ubuntu doesn't support newest sun JDKs}... I looked around and apparently this can be solved by using openJDK 1.6.0.11, but I've had... issues... with openJDK in the past. If anyone has a better solution than going back to 1.5, or can confirm openJDK, I'd love to hear it! PS - On a random sidenote, earlier this morning I was greeted by strange crashes in IE6 when trying to animate opacity on clipped ImageBundle images; works fine on normal elements, but not the clippers... --~--~-~--~~~---~--~~ 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: Next Release
From what I've read the GWT guys say, internally, Google uses trunk, so it's stable (I also used trunk and it was stable for me too). On Mon, May 11, 2009 at 2:44 AM, Noel noel.tr...@gmail.com wrote: No, that will be my option of last resort I suppose. Mostly I don't have any idea how stable the GWT trunk code is, having not been a contributor or followed the development closely. If I could get an idea of when the next release will be, I could then decide if I want to put in the effort to mess around with trunk or if it is an acceptable time frame for our team to just wait for the next release. On May 11, 12:58 am, Vitali Lovich vlov...@gmail.com wrote: Is there any particular reason you can't build from trunk? It's pretty stable. On Sun, May 10, 2009 at 7:26 AM, Noel noel.tr...@gmail.com wrote: Does anyone know when the code currently in the GWT trunk will make it into a production ready release? We are currently on 1.6.4 but there is a particular feature implemented in the trunk code that I really need - RemoteServiceProxy.setRpcRequestBuilder(RpcRequestBuilder). Thank-you, Noel --~--~-~--~~~---~--~~ 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: Chrome Safari Compatibility
Safari is supported AFAIK. Chrome would be too since it is Webkit like Safari, although I don't know how much QA effort goes towards it - probably minimal for three reasons: 1) it uses the same engine as Safari 2) it has minimal browser share 3) it's Google's browser that they want as standards compliant as possible, meaning few/no browser-specific workarounds are necessary ( since there's only 1 version with a 2nd on the way, it's not much of an issue). The combination of 1 2 make spending time on heavy QA of Chrome explicitly (outside of maybe some unofficial smoke tests) probably unlikely. However, I have no idea what the process is internally, so my guess could be way off. On Tue, May 12, 2009 at 4:52 PM, Salvador Diaz diaz.salva...@gmail.comwrote: http://code.google.com/webtoolkit/doc/1.6/FAQ_GettingStarted.html#Browsers_and_Servers It should be noted however that this doesn't mean that GWT is not preferred to be deployed on Chrome or Safari just that there will probably be some layout differences. There are almost always workarounds for layout differences, it's just a matter of making choices and compromises. Cheers, Salvador On May 12, 9:39 pm, Blessed Geek blessedg...@gmail.com wrote: Rather, it is more accurate to say that I set the absolute distance of the panels 90px from the top of the root panel - to make room for page logo and header text. --~--~-~--~~~---~--~~ 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: Chrome Safari Compatibility
Difficult to determine the issue without the CSS some sample code, it's difficult to guess at the problem (might be a quirks issue). On a side note, just to clarify that you explained yourself correctly, hosted mode browser is only IE on Windows (at least until GWT 2.0). Mozilla on Linux. Safari on OSX. On Tue, May 12, 2009 at 3:39 PM, Blessed Geek blessedg...@gmail.com wrote: Rather, it is more accurate to say that I set the absolute distance of the panels 90px from the top of the root panel - to make room for page logo and header text. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[gwt-contrib] Re: Add getElementsByClassName support
On Tue, May 12, 2009 at 4:49 PM, Joel Webber j...@google.com wrote: On Tue, May 12, 2009 at 4:38 PM, Ray Cromwell cromwell...@gmail.comwrote: On Tue, May 12, 2009 at 1:26 PM, j...@google.com wrote: - This class also appears to be doing runtime detection of (document.evaluate). I think we should be able to make this solely dependent upon the browser overload and ditch the runtime switch. The problem is, firefox3 has this method, but firefox2 needs to use document.evaluate, so you either have to add a deferred binding just for this, or you do a runtime test and cache the result, something like public native void initGetElementsByClassName() /*-{ this.getElementsByClassName = nativeTest ? th...@com.google.gwt.user.client.domimpl ::getElementsByClassNameNative(Ljava/lang/String;) : th...@com.google.gwt.user.client.domimpl ::getElementsByClassNameXPath(Ljava/lang/String;); }-*/; I see. That makes sense. In this case, though, it would be nice to move that logic into the DOMImplMozilla so that it doesn't clutter up the standard case. - Don't forget IE8 support (I slipped it into trunk as a new user-agent value recently). They added support for querySelectorAll(), which is nice. I haven't looked at IE8 yet. It's fine to use querySelectorAll to implement getElementsByClassName as a faster way for IE8. Eventually, querySelectorAll needs to make it into the API by itself, although that will require more effort probably since the Javascript emulation of that one is probably far more complicated. Yes, you can use querySelectorAll for this, although short-circuiting to getElementsByClassName() if it's native is faster on some browsers. Again, the IE6 vs IE8 issue will crop up requiring either another deferred binding, or a runtime-test. querySelectorAll would only make sense with IE8 no? I think it's the only browser that didn't implement both at the same time (or in any case, getElementsByClassName probably came first). There will be some overlap between this and the Gwt Query based selector stuff too. Good point. If you guys could coordinate to make sure there's at least a chance of GwtQuery using this interface (to the extent it needs getElementsByClassName() at all), that would be great. -Ray --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Add getElementsByClassName support
On Tue, May 12, 2009 at 4:26 PM, j...@google.com wrote: Thanks for digging into this -- it'll be helpful for a lot of developers. And sorry I've taken so long to get around to reviewing -- I've been pretty swamped lately. I'm going to ask Ray to come back and review some of the DOM details a bit more, but I'd like to address a couple of broader structural questions myself. - It's not entirely clear to me why DOMImplStandard.ElementsByClassName is its own inner class. This was so that the overhead was as low as possible. 1) Situation 1 - Program doesn't use getElementsByClassName. This whole code path will be stripped out by the compiler (not a reason for the inner class, just my thought process when I was writing this). 2) Situation 2 - Program does use getElementsByClassName. 2 ways to implement. a) initialize the prototypes ahead of time with the appropriate implementation. b) determine the appropriate function dynamically on every invocation. The inner class was the only way I could think of to satisfy 2a while supporting 1 so that there's some minimal startup code to pick the right implementation, but the invocation is as fast as can possibly be. Optionally, I could have made the startup code common to everyone, but then that just adds overhead for people who will never use this function. Or I could have done something like if (e.getElementsByClassName) { return e.getElementsByClassName(class name); } Element.prototype.getElementsByClassName = function() { //whatever }; document.getElementsByClassName = function() { // whatever }; - I also don't think it should be adding methods to the document object. - It runs the risk of conflicting with other js libs, and there's almost always a better way to hang onto those values Considering the native versions added getElementsByClassName to the document object, I don't see a potential conflict. All the libraries I looked at were fixed a while back too because they clobbered the native version with the emulated code. This code also checks for document.getElementsByClassName first. That means if a user wants to use the JS libraries version of it (I wouldn't know why since the GWT version would be faster smaller), he would just have to make sure that it gets registered first (the implementation I wrote doesn't clobber the existing getElementsByClassName). (remember you can add static fields to the DOMImpl classes if you need to). what is this in reference to? - This class also appears to be doing runtime detection of (document.evaluate). I think we should be able to make this solely dependent upon the browser overload and ditch the runtime switch. As Ray pointed out, FF2 breaks this for us. Just to expand, so does every standards compliant browser at some point (a while back I was asking about supported browser versions for particularly this reason - all the versions had, as far as I could tell, non-XPath, followed by XPath, followed by native getElementsByClassName, hence the reason I made it standard. - It would be nice to have a brief doc (even if it's just on the contrib list), detailing which approaches work on which browsers. Yes - I should have written this down to begin with. I'll have to look it up again. From what I can remember I believe it went like this: * IE8 = DOM IE8 = XPath through querySelectorAll (implementation still needs to be written) FF2 = DOM FF3 = XPath through document.evaluate *= FF3 = native Safari 3 = XPath *= Safari 3.1 = native Safari 2 = not clear about this - might be XPath, might be DOM. Can't find clear documentation on this don't have a Mac. Opera = todo. They don't seem to have a good changelog (at least that I can find) of when features like this were added. But don't hold me to any of this - it's all from memory (except for those marked *). - Don't forget IE8 support (I slipped it into trunk as a new user-agent value recently). They added support for querySelectorAll(), which is nice. Yup. Might pose a problem with quirks mode, but no probably no more so than any of the other XPath methods. - This could really use some tests. There is a lot of complex behavior here, and it would be nice to have some confirmation that it works :) Yes that would be nice. I've been on vacation for a while - this is on my todo list. - If you need a hand running tests across browsers, send me patches and I'll be glad to do it here. Sweet :D. I think first we need to come up with a matrix of browsers versions. My list: IE6, IE8 (IE7 optional - should be functionally equivalent to IE6) Firefox 1.5, Firefox 2, Firefox 3 Safari 2, Safari 3, Safari 4 (Safari 3.1 is optional, but should be functionally equivalent to 4) Opera 8.5 (first free version about the same age as FF 1.5), Opera 9.0, Opera 9.5 Bonus: Chrome, Konqueror Is that a reasonable approximation? Too much? Too little? Wrong versions? http://codereview.appspot.com/44041/diff/1/5
Re: Gears GWT API on Android behaving differently?
yeah... not really sure what you're trying to do with the split algorithm - it's unnecessarily messy. try just using JSNI - I'm not sure why you're having problems with the Java regexp. Have you tried 1.6? It seems like this is a bug in GWT. private static native String fixQuery(String query, String value) /*--{ return query.replace(/[?]/, value); } --*/; for (int i = 0; i params.length; i++) { String fixed = fixQuery(statement, params[i]); assert (!statement.equals(fixed)); statement = fixed; } Again, I still think you are doing something wrong with the Gears API if you have to use this hack (I haven't used gears. Have you tried writing the Javascript equivalent? You could also try to use JSNI - maybe the GWT gears API has some problems: private void nativeGears(Database db, String sql, long userid, String sessionid, String name, String email) { db.execute(sql, [userid, sessionid, name, email]); } try { tryGears(db, statement, theUser.id, theUser.currentSessionId , theUser.name , ); } catch (Exception e) { e.printStackTrace(); } If this works, then there's probably something wrong with the Java code (or maybe a bug with GWT). Try upgrading to 1.6 if that doesn't work. If it still doesn't work, write the Javascript equivalent. Also, you've got a logic problem with selectUserByUserId algorithm First of all, the for loop should be for (; rs.isValidRow(); rs.next() ). The i counter is redundant. This brings me to the next point - the for loop is redundant in your algorithm you will never execute rs.close unless there is nothing in your result set. Maybe this is what you were trying for? public User selectUserByUserId( long userId ) { final String[] params = new String[] { Long.toString( userId ) }; User user = null; ResultSet rs = null; try { rs = db.execute( SELECT_USER, params ); if (rs.isValidRow()) { user = new User(); user.setId( rs.getFieldAsLong( 0 ) ); user.setCurrentSessionId( rs.getFieldAsString( 1 ) ); user.setName( rs.getFieldAsString( 2 ) ); if (!GWT.isScript()) { rs.next(); assert (!rs.isValidRow()); user = null; } } } catch ( DatabaseException e ) { debugDBException( selectUserByUserId, params, e ); } finally { if (rs != null) { rs.close(); } } return user; } By the way, there might be a problem with your attempt to manually bind your values when you insert. Since you always append quotes around the paramters, they will always be treated as strings. Since SQLite does not honour the column type, you may see issues appear (at the very best, it'll manifest as performance problems). On Mon, May 11, 2009 at 10:37 AM, Evan Ruff evan.r...@gmail.com wrote: Vitali, GWT does not seem too excited about Matcher and bombs out completely. I don't believe it's compatible client side, as it says java.util.regex cannot be imported. I've confirmed that Gears on Android does not support sentences with another user. I misspoke when I posted my code snippet, I was using replaceFirst. As I stated before that Regexp ([?]) does not appear to match ? as replaceFirst does not ever replace the ?. \\? does not seem to work in replaceFirst either; however, \\? does work with .split. So, I think the two solutions I've got so far are: for ( int i = 0; ( statement.indexOf( ? ) 0 ); i++ ) { int index = statement.indexOf( '?' ); String firstPart = statement.substring( 0, index ); String secondPart = statement.substring( index + 1 ); StringBuilder sb = new StringBuilder(); sb.append( firstPart ).append( \ ).append( params[ i ] ).append ( \ ).append( secondPart ); statement = sb.toString(); } return statement; OR StringBuilder sb = new StringBuilder(); String[] splits = statement.split( \\? ); int j = 0; sb.append( splits[ 0 ] ); for( int i = 1; i splits.length; i++ ) { sb.append( '' ).append( params[ j ] ).append( '' ).append( splits [ i ] ); j++; } if ( j params.length ) { sb.append( '' ).append( params[ j ] ).append( '' ); j++; } if ( j != params.length ) { throw new IndexOutOfBoundsException(); } return sb.toString(); With neither method being particularly quick. I suspect the second method will give better general performance. E On May 8, 10:46 am, Vitali Lovich vlov...@gmail.com wrote: Have you read the Javadoc? replace replaces string literals. You need myString.replaceAll([?], newString); or myString.replace(?, newString). In any case, it's not what you want since it replaces *all* instances of ? with the same string. Try this: Matcher m = Pattern.compile
Re: Next Release
Is there any particular reason you can't build from trunk? It's pretty stable. On Sun, May 10, 2009 at 7:26 AM, Noel noel.tr...@gmail.com wrote: Does anyone know when the code currently in the GWT trunk will make it into a production ready release? We are currently on 1.6.4 but there is a particular feature implemented in the trunk code that I really need - RemoteServiceProxy.setRpcRequestBuilder(RpcRequestBuilder). Thank-you, Noel --~--~-~--~~~---~--~~ 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: Image Quality Affected during File Upload
maybe you're not saving it correctly when you write it out to a file? have you checked to see if the file has the exact same content on the client-side server side? On Sun, May 10, 2009 at 12:36 AM, abhiram abhir...@gmail.com wrote: hi vitali, i am sure there is no problem with my viewer. I believe the data is getting tampered when recieved by the servlet. Further, one more thing that i noticed was that, if the image is of low quality say a 16 Color Bitmap image, then the data is getting transferred almost perfectly and the image is being seen perfectly. So,i thought, higher the resolution, the data is getting tampered... Please let me know if something needs to be done at the servlet side coding for capturing the data perfectly... On May 10, 9:16 am, Vitali Lovich vlov...@gmail.com wrote: do a binary diff. if they are the same, then there's a problem with your viewer. On Sat, May 9, 2009 at 6:20 AM, abhiram abhir...@gmail.com wrote: Hi all, I am trying an image upload application, where in I am transferring .jpg / .bmp images to a location on the server. But when i do that I see that the quality of the image is lost. When i compare the two images i see that both are of same size. Not sure, why this thing is happening. Can anyone please suggest what might be a possible solution?- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Gears GWT API on Android behaving differently?
Have you read the Javadoc? replace replaces string literals. You need myString.replaceAll([?], newString); or myString.replace(?, newString). In any case, it's not what you want since it replaces *all* instances of ? with the same string. Try this: Matcher m = Pattern.compile([?]).matcher(myString); int i = 0; while (!m.hitEnd()) { m.replaceFirst('' + params[i++] + ''); } You could use String.replaceFirst, but this should be better performing. Otherwise, you have to do: String newString; int i = 0; while (!(newString = myString.replaceFirst([?], '' + params[i++] + '')).equals(myString)) { myString = newString; } but that might be slower than even the split method I gave earlier. And if this code is really slow, there's a faster JSNI way because Javascript has a faster way for literal regexps I don't believe the compiler makes that optimization yet. In any case, I would really recommend trying to figure out why your SQL stuff doesn't work first, because that is the core of the problem. All of this stuff is just hacky workarounds. You really should write the equivalent little javascript snippet see if that works. If it doesn't, then post to the android list because it's a problem with your code. On Fri, May 8, 2009 at 8:33 AM, Evan Ruff evan.r...@gmail.com wrote: I was going with the ol: myString.replace( [?], newString ); but that would not find the ?, so I went with a \\?, also unsuccessfully. E On May 8, 12:00 am, Vitali Lovich vlov...@gmail.com wrote: What is the exact Java code snippet that you are using? On Thu, May 7, 2009 at 10:10 PM, Evan Ruff evan.r...@gmail.com wrote: Vitali, I was just trying to match '?' in the SQL statement, such as: INSERT into users ( name, city ) VALUES( ?, ? ) so I can mash up my own prepare SQL statement. Also, I can run the test on the android phone to see if that might be the problem. E On May 7, 4:36 pm, Vitali Lovich vlov...@gmail.com wrote: What's the code for the regexp that you are trying what is the source string that you are matching against. On Thu, May 7, 2009 at 3:24 PM, Evan Ruff evan.r...@gmail.com wrote: Vitali, Thanks for your response! That RegExp for the ? was giving me trouble, as it wouldn't match. I also tried [\\?] without success as well. Any idea on how to find that guy? Thanks, E On May 7, 2:59 pm, Vitali Lovich vlov...@gmail.com wrote: Javascript Java have different regular expressions, so if you are running your stuff on desktop browsers in Hosted Mode but compiled mode in Android, then you might be running into that problem. A performance improvement should be: String statement = new String( sqlStatement ); StringBuffer sb = new StringBuffer(statement.length()); int index; int previous = 0; int i = 0; while ((index = statement.indexOf('?')) != -1) { String firstPart = statement.substring( previous, index ); sb.append (firstPart).append('').append(params[i++]).append(''); previous = index + 1; } return sb.toString(); or try String statement = new String( sqlStatement ); String [] parts = statement.split([?]); StringBuffer sb = new StringBuffer(statement.length + parts.length * AVERAGE_PARAM_LENGTH); for (int i = 0; i parts.length; i++) { sb.append(parts[i]).append('').append(params[i]).append('') } AVERAGE_PARAM_LENGTH can be anything, but you want the resultant expression to be as close as possible to the actual final length as possible, without going under (assuming this portion of code is your hotpath - otherwise, you won't notice the difference). On Thu, May 7, 2009 at 2:12 PM, Evan Ruff evan.r...@gmail.com wrote: Ok so something really fishy is going on with the Gears API. I created my own prepareSQLStatement that converts the SQL Call and parameter list into a string. private String prepareSQLStatement( String sqlStatement, String[] params ) throws DatabaseException { try { String statement = new String( sqlStatement ); for ( int i = 0; ( statement.indexOf( ? ) 0 ); i++ ) { int index = statement.indexOf( '?' ); String firstPart = statement.substring( 0, index ); String secondPart = statement.substring( index + 1 ); StringBuffer sb = new StringBuffer(); sb.append( firstPart ).append( \ ).append
Re: Programmatically Load a Module
Yes. For one, a hacky way would be to have each application register itself in the onModuleLoad. i.e. package foo; class ApplicationA { private native void register() /*-- { $wnd.applications.push(t...@foo.applicationa::load()()); }--*/; private native void load() { // the function is loaded } private void onModuleLoad() { register(); } } rinse repeat for the other applications. Then simply include them in the HTML as you would with your main app. The downside, is that all of them get loaded at once on startup. However, the more proper way would be to bundle the other applications as proper GWT modules have your main one inherit from them. Then supply programmatic entry points into the applications via a custom interface, ie public interface DynamicLoad { void onApplicationSelected(SimplePanel parent); } The downside to either approach is that you need to load all your applications at once. Trunk has runAsync which solves this problem but it would be far easier to integrate with the second approach. On Fri, May 8, 2009 at 8:07 AM, M V mdmv1...@gmail.com wrote: Hi All, Is it possible to load a gwt application directly from code??? What I want is to provide a list of applications available in a drop down and without reloading the page to load the gwt application selected into a div. I checked a using lazy panels but I have to have the widget I want in the gwt application itself. What I want is something like the javascript native function *eval(string) *but for a entire gwt application (module). Thanks in advance... MV --~--~-~--~~~---~--~~ 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: Unique identifier
I've seen people have problems with that approach (at least within the GWT context). I prefer to just manually generate my session ids set that in the sid cookie. public static final byte [] VALID_SESSION_CHAR = new byte[10 + ('z' - 'a' + 1)]; private static final SecureRandom rand = new SecureRandom(); static { for (byte i = 0; i 10; i++) VALID_SESSION_CHAR[i] = '0' + i; for (byte i = 'z' - 'a'; i = 0; i--) VALID_SESSION_CHAR[i] = 'a' + i; } static String authenticate(String clientName, String username, String password) { if (!isValid(username, password)) { // perhaps detect too many invalid attempts from clientName in a short period of time block temporarily throw new AuthenticationException(); } byte[] sessionID = new byte[SESSION_ID_LENGTH]; int failCount = 0; // set a transaction save point (if not supported, then you have to rework the logic). while (++failCount MAX_FAIL_COUNT) { for (int i = SESSION_LENGTH - 1; i = 0; i--) { sessionID[i] = VALID_SESSION_CHAR[rand.nextInt(VALID_SESSION_CHAR.length)]; } // try to insert sessionID into a table where the session ID is unique - on failure, reset to save point } if (failCount == MAX_FAIL_COUNT) { // couldn't generate the session id - maybe the session id length is too small throw new AuthenticationException(); } // complete transaction return new String(sessionID); } static void createSession(String username, String password) { String sessionID = authenticate(getThreadLocalRequest().getRemoteAddr(), username, password); Cookie sid = new Cookie(sid, sessionID); getThreadLocalResponse().addCookie(sid); } 2009/5/7 Joakim Sjöberg joakim.sjob...@artificial-solutions.com Hi! Just wanted to say thank you for your help! It worked nicely! // Joakim -Original Message- From: Google-Web-Toolkit@googlegroups.com [mailto: google-web-tool...@googlegroups.com] On Behalf Of Adligo Sent: Thursday, May 07, 2009 1:37 AM To: Google Web Toolkit Subject: Re: Unique identifier Hi, I would go with the HttpSession identifier, it should always be unique (something like 1 in 1 billion chance it will duplicate over a year). Also if I was going to add a log to do it, I would use the adligo i_log code (I'm partial I wrote it), but its already on in your Servlet api so assumeing your calling a rpc mehod somewhere. //something like... myRPC() { super.getThreadLocalRequest().getSession().getId(); } Cheers, Scott On May 6, 2:43 pm, Joakim Sjöberg joakim.sjob...@artificial- solutions.com wrote: Hi! Seems good, but I still got the problem with the unique identifier, right? // Joakim -Original Message- From: Google-Web-Toolkit@googlegroups.com [mailto: google-web-tool...@googlegroups.com] On Behalf Of Salvador Diaz Sent: Wednesday, May 06, 2009 4:46 PM To: Google Web Toolkit Subject: Re: Unique identifier You could use gwt-log:http://code.google.com/p/gwt-log/ with a RemoteLogger Hope that helps, Salvador On May 6, 4:33 pm, Joakim Sjöberg joakim.sjob...@artificial- solutions.com wrote: Hi! Yes I know that, more or less what I want is some way to uniquely identify every time a user goes into my page. When they do that I want to put that into a database (for example time when they used my page) and in the end I want when they come to the end of my page (it's a form page) record the time when they were finished. And for that I need to have a unique identifier that I can use to update the database with. Hope this helps to explain more what I want. // Joakim -Original Message- From: Google-Web-Toolkit@googlegroups.com [mailto: google-web-tool...@googlegroups.com] On Behalf Of Salvador Diaz Sent: Wednesday, May 06, 2009 4:16 PM To: Google Web Toolkit Subject: Re: Unique identifier What do you call a GWT instance ? Do you know that GWT applications are just HTML + js + servlets ? (servlets are the RPC implementations) On May 6, 12:53 pm, Joakim Sjöberg joakim.sjob...@artificial- solutions.com wrote: Hello! I am trying to build a function that stores data about each GWT instance that is running in a database. Is there anyway way to get some sort of unique identifier from GWT in an easy way? I have looked some at session handling, is that the right way to go? Should I use the RPC functionality for this? Joakim Sjöberg Technical Consultant --~--~-~--~~~---~--~~ 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
Re: A widget that has an existing parent widget may not be added to the detach list
No it's not. You aren't using it correctly. Panel actionsarea = RootPanel.get(actionpanel); ActionsView actions = new ActionsView(); actions.setMainPanel(actionsarea); I'm going to go out on a limb here say it's the third line where the exception gets thrown. Here's what I think you are doing (not really sure what ActionsView is doing, so this is conjecture): RootPanel.get() - wrapping an HTML component in a GWT widget actions.setMainPanel(actionsarea); - putting something that is a GWT widget that is wrapping an HTML component into another GWT widget. This is not allowed (as per the diagram I gave previously). The actionpanel div already has an HTML parent element (the div with id applicationarea). You cannot add this to another GWT widget. On Thu, May 7, 2009 at 2:25 PM, marco m.massen...@googlemail.com wrote: This happens also for perfectly 'legal' HTML: div id=staticarea / div id=applicationarea div id=menuarea / div id=clientarea / div id=actionpanel / /div (the reason for doing so is that by using CSS I can easily position the four areas in the client area - see attached) Here's the code that generates the AssertionError: public void onModuleLoad() { Container.getInstance().registerController(this); Panel clientarea = RootPanel.get(clientarea); Label holding = new Label(); holding.setText(work in progress...); clientarea.add(holding); Panel menuarea = RootPanel.get(menuarea); MenuView menuView = new MenuView(menuarea); registerView(ViewType.MENU, menuView); menuView.render(); // This causes the exception to be raised: Panel actionsarea = RootPanel.get(actionpanel); ActionsView actions = new ActionsView(); actions.setMainPanel(actionsarea); registerView(ViewType.ACTION, actions); actions.render(); } IMHO this is a genuine GWT bug On Apr 28, 8:40 pm, Vitali Lovich vlov...@gmail.com wrote: Yes. Use GWT properly. Don't use raw HTML. That's your problem. Instead of adding an HTML widget that wraps a div, use a SimplePanel set it's id if you need to. Look at the showcase - it shows you a brief overview of most (all?) the widgets GWT has. Think of using raw HTML in your app as something akin to JSNI - only do it if you know what you are doing, otherwise you're just going to shoot yourself in the foot. The only time raw HTML is commonly used is in the constructor of some Widgets (you'll see a boolean asking if you want to treat the string as text or html). The rule of thumb to use is as follows: HTML element | v wrapping GWT root panel | v GWT widgets panels | v HTML possible Do not put GWT widgets below HTML possible. Do not wrap HTML possible in GWT widgets. HTML element can have sibling elements that get wrapped with GWT. Hopefully this'll clarify it for you. On Tue, Apr 28, 2009 at 4:52 AM, kohlyn co...@solas.net wrote: Any suggested workarounds? I currently load a page layout in HTML (Header/Menu Bar/Footer) ... then in each section I load different HTML layouts depending on the user, and then I add the controls. On Apr 27, 6:15 pm, Vitali Lovich vlov...@gmail.com wrote: Yes this has already come up on the mailing list. This was always illegal, just uncaught prior to 1.6. You cannot wrap two elements in GWT if they already have a parent/child relationship in the DOM (causes a mismatch in the trees). Do a search you'll find the response from the GWT developer regarding this issue. On Mon, Apr 27, 2009 at 11:12 AM, kohlyn co...@solas.net wrote: I'm getting the following errors with 1.6.4 on a Mac. A widget that has an existing parent widget may not be added to the detach list The HTML is: body !-- OPTIONAL: include this if you want history support -- iframe src=javascript:'' id=__gwt_historyFrame tabIndex='-1' style=position:absolute;width:0;height:0;border:0/iframe h1Web Application Starter Project/h1 div id=testdiv/div /body Code: public void onModuleLoad() { HTMLPanel p = new HTMLPanel(div id=\testdiv2\Test Div 2/ div); RootPanel.get(testdiv).add(p); final TextBox txtUsername = new TextBox(); RootPanel.get(testdiv2).add(txtUsername); } } This code worked in the 1.4 and 1.5 branches, but not 1.6. The line: RootPanel.get(testdiv2).add(txtUsername); throws the exception. A widget that has an existing parent widget may not be added to the detach list The problems appears to be with a new check in RootPanel.detachOnWindowClose(Widget widget) assert !isElementChildOfWidget(widget.getElement()) : A widget that has + an existing parent widget
Re: Gears GWT API on Android behaving differently?
Javascript Java have different regular expressions, so if you are running your stuff on desktop browsers in Hosted Mode but compiled mode in Android, then you might be running into that problem. A performance improvement should be: String statement = new String( sqlStatement ); StringBuffer sb = new StringBuffer(statement.length()); int index; int previous = 0; int i = 0; while ((index = statement.indexOf('?')) != -1) { String firstPart = statement.substring( previous, index ); sb.append (firstPart).append('').append(params[i++]).append(''); previous = index + 1; } return sb.toString(); or try String statement = new String( sqlStatement ); String [] parts = statement.split([?]); StringBuffer sb = new StringBuffer(statement.length + parts.length * AVERAGE_PARAM_LENGTH); for (int i = 0; i parts.length; i++) { sb.append(parts[i]).append('').append(params[i]).append('') } AVERAGE_PARAM_LENGTH can be anything, but you want the resultant expression to be as close as possible to the actual final length as possible, without going under (assuming this portion of code is your hotpath - otherwise, you won't notice the difference). On Thu, May 7, 2009 at 2:12 PM, Evan Ruff evan.r...@gmail.com wrote: Ok so something really fishy is going on with the Gears API. I created my own prepareSQLStatement that converts the SQL Call and parameter list into a string. private String prepareSQLStatement( String sqlStatement, String[] params ) throws DatabaseException { try { String statement = new String( sqlStatement ); for ( int i = 0; ( statement.indexOf( ? ) 0 ); i++ ) { int index = statement.indexOf( '?' ); String firstPart = statement.substring( 0, index ); String secondPart = statement.substring( index + 1 ); StringBuffer sb = new StringBuffer(); sb.append( firstPart ).append( \ ).append( params[ i ] ).append ( \ ).append( secondPart ); statement = sb.toString(); } return statement; } catch ( IndexOutOfBoundsException indexOut ) { throw new DatabaseException( Index out of bounds. SQL Parameter Error ); } } When I use this method to prepare the statement before hitting db.execute, all of my sql statements work as expected. Could Android implement it's string manipulation stack slightly differently than all the other platforms? I've got a sneaky suspecion that the RegExp that's used to parse the '?' in the SQL commands might be failing? Furthermore, can anyone give me an ideas as how to improve the performance of the above method? It creates a noticable delay. Did I read somewhere that GWT has a slow string manipulation engine? E On May 6, 2:07 pm, Evan Ruff evan.r...@gmail.com wrote: Hey Eric, I'm pretty much terrified of Javascript. I'm a little hesitant to make any determination whatsoever as to the cause of the problem. When I run the GWT Gears Sample DatabaseDemo project, it works as expected. I can even replace all of the DB specifics with the internals of my tables/queries and it seems to work! It's just so freakin' frustrating. RememberTheMilk and the mobile GMail seem to make use of Gears on Android without issue, so I really don't know where to go from here. Any other suggestions? Here's the replaced DatabaseDemo code, fwiw: public class Gears implements EntryPoint { private static final int NUM_SAVED_ROWS = 3; private static final int NUM_DATA_TABLE_COLUMNS = 3; private final Button addButton = new Button( Add ); private final Button clearButton = new Button( Clear Database ); private Database db; private final TextBox input = new TextBox(); private final FlexTable dataTable = new FlexTable(); public void onModuleLoad() { VerticalPanel outerPanel = new VerticalPanel(); outerPanel.setSpacing( 10 ); outerPanel.getElement().getStyle().setPropertyPx( margin, 15 ); HorizontalPanel textAndButtonsPanel = new HorizontalPanel(); textAndButtonsPanel.add( new Label( Enter a Phrase: ) ); textAndButtonsPanel.add( input ); textAndButtonsPanel.add( addButton ); textAndButtonsPanel.add( clearButton ); outerPanel.add( textAndButtonsPanel ); outerPanel.add( new Label( Last 3 Entries: ) ); outerPanel.add( dataTable ); for ( int i = 0; i = NUM_SAVED_ROWS; ++i ) {
Re: Gears GWT API on Android behaving differently?
Oh yeah - didn't notice that you were using StringBuffer. StringBuilder is the appropriate one. I had assumed that sqlStatement was perhaps an array or something - if it's another string, then yes, you do not need to create a copy like that since they are immutable. The while loop instead of for loop shouldn't save him anything in this case. On Thu, May 7, 2009 at 2:42 PM, Eric Ayers zun...@google.com wrote: Your best bet for android specific stuff would be to ask on the android-users group. Here are some general observations inline: On Thu, May 7, 2009 at 2:12 PM, Evan Ruff evan.r...@gmail.com wrote: Ok so something really fishy is going on with the Gears API. I created my own prepareSQLStatement that converts the SQL Call and parameter list into a string. private String prepareSQLStatement( String sqlStatement, String[] params ) throws DatabaseException { try { String statement = new String( sqlStatement ); performance: There's no need to make a copy of the string here. Strings are immutable. for ( int i = 0; ( statement.indexOf( ? ) 0 ); i++ ) You probably want a while loop here: while(statement.indexOf(?) 0) { ... } { int index = statement.indexOf( '?' ); String firstPart = statement.substring( 0, index ); String secondPart = statement.substring( index + 1 ); StringBuffer sb = new StringBuffer(); performance: Try using StringBuilder instead of StringBuffer. http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuilder.html sb.append( firstPart ).append( \ ).append( params[ i ] ).append ( \ ).append( secondPart ); statement = sb.toString(); performance: I don't know how big your SQL statement is or how many parameters you have, but you are scanning it over and over from the beginning of the string. You really only need to analyze it from the end if the previous indexOf() line. } return statement; } catch ( IndexOutOfBoundsException indexOut ) { throw new DatabaseException( Index out of bounds. SQL Parameter Error ); } } When I use this method to prepare the statement before hitting db.execute, all of my sql statements work as expected. Could Android implement it's string manipulation stack slightly differently than all the other platforms? I've got a sneaky suspecion that the RegExp that's used to parse the '?' in the SQL commands might be failing? Furthermore, can anyone give me an ideas as how to improve the performance of the above method? It creates a noticable delay. Did I read somewhere that GWT has a slow string manipulation engine? E On May 6, 2:07 pm, Evan Ruff evan.r...@gmail.com wrote: Hey Eric, I'm pretty much terrified of Javascript. I'm a little hesitant to make any determination whatsoever as to the cause of the problem. When I run the GWT Gears Sample DatabaseDemo project, it works as expected. I can even replace all of the DB specifics with the internals of my tables/queries and it seems to work! It's just so freakin' frustrating. RememberTheMilk and the mobile GMail seem to make use of Gears on Android without issue, so I really don't know where to go from here. Any other suggestions? Here's the replaced DatabaseDemo code, fwiw: public class Gears implements EntryPoint { private static final int NUM_SAVED_ROWS = 3; private static final int NUM_DATA_TABLE_COLUMNS = 3; private final Button addButton = new Button( Add ); private final Button clearButton = new Button( Clear Database ); private Database db; private final TextBox input = new TextBox(); private final FlexTable dataTable = new FlexTable(); public void onModuleLoad() { VerticalPanel outerPanel = new VerticalPanel(); outerPanel.setSpacing( 10 ); outerPanel.getElement().getStyle().setPropertyPx( margin, 15 ); HorizontalPanel textAndButtonsPanel = new HorizontalPanel(); textAndButtonsPanel.add( new Label( Enter a Phrase: ) ); textAndButtonsPanel.add( input ); textAndButtonsPanel.add( addButton ); textAndButtonsPanel.add( clearButton ); outerPanel.add( textAndButtonsPanel ); outerPanel.add( new Label( Last 3 Entries: ) ); outerPanel.add( dataTable ); for ( int i = 0; i = NUM_SAVED_ROWS; ++i ) {
Re: Gears GWT API on Android behaving differently?
What's the code for the regexp that you are trying what is the source string that you are matching against. On Thu, May 7, 2009 at 3:24 PM, Evan Ruff evan.r...@gmail.com wrote: Vitali, Thanks for your response! That RegExp for the ? was giving me trouble, as it wouldn't match. I also tried [\\?] without success as well. Any idea on how to find that guy? Thanks, E On May 7, 2:59 pm, Vitali Lovich vlov...@gmail.com wrote: Javascript Java have different regular expressions, so if you are running your stuff on desktop browsers in Hosted Mode but compiled mode in Android, then you might be running into that problem. A performance improvement should be: String statement = new String( sqlStatement ); StringBuffer sb = new StringBuffer(statement.length()); int index; int previous = 0; int i = 0; while ((index = statement.indexOf('?')) != -1) { String firstPart = statement.substring( previous, index ); sb.append (firstPart).append('').append(params[i++]).append(''); previous = index + 1; } return sb.toString(); or try String statement = new String( sqlStatement ); String [] parts = statement.split([?]); StringBuffer sb = new StringBuffer(statement.length + parts.length * AVERAGE_PARAM_LENGTH); for (int i = 0; i parts.length; i++) { sb.append(parts[i]).append('').append(params[i]).append('') } AVERAGE_PARAM_LENGTH can be anything, but you want the resultant expression to be as close as possible to the actual final length as possible, without going under (assuming this portion of code is your hotpath - otherwise, you won't notice the difference). On Thu, May 7, 2009 at 2:12 PM, Evan Ruff evan.r...@gmail.com wrote: Ok so something really fishy is going on with the Gears API. I created my own prepareSQLStatement that converts the SQL Call and parameter list into a string. private String prepareSQLStatement( String sqlStatement, String[] params ) throws DatabaseException { try { String statement = new String( sqlStatement ); for ( int i = 0; ( statement.indexOf( ? ) 0 ); i++ ) { int index = statement.indexOf( '?' ); String firstPart = statement.substring( 0, index ); String secondPart = statement.substring( index + 1 ); StringBuffer sb = new StringBuffer(); sb.append( firstPart ).append( \ ).append( params[ i ] ).append ( \ ).append( secondPart ); statement = sb.toString(); } return statement; } catch ( IndexOutOfBoundsException indexOut ) { throw new DatabaseException( Index out of bounds. SQL Parameter Error ); } } When I use this method to prepare the statement before hitting db.execute, all of my sql statements work as expected. Could Android implement it's string manipulation stack slightly differently than all the other platforms? I've got a sneaky suspecion that the RegExp that's used to parse the '?' in the SQL commands might be failing? Furthermore, can anyone give me an ideas as how to improve the performance of the above method? It creates a noticable delay. Did I read somewhere that GWT has a slow string manipulation engine? E On May 6, 2:07 pm, Evan Ruff evan.r...@gmail.com wrote: Hey Eric, I'm pretty much terrified of Javascript. I'm a little hesitant to make any determination whatsoever as to the cause of the problem. When I run the GWT Gears Sample DatabaseDemo project, it works as expected. I can even replace all of the DB specifics with the internals of my tables/queries and it seems to work! It's just so freakin' frustrating. RememberTheMilk and the mobile GMail seem to make use of Gears on Android without issue, so I really don't know where to go from here. Any other suggestions? Here's the replaced DatabaseDemo code, fwiw: public class Gears implements EntryPoint { private static final int NUM_SAVED_ROWS = 3; private static final int NUM_DATA_TABLE_COLUMNS = 3; private final Button addButton = new Button( Add ); private final Button clearButton = new Button( Clear Database ); private Database db; private final TextBox input = new TextBox(); private final FlexTable dataTable = new FlexTable(); public void onModuleLoad() { VerticalPanel outerPanel = new VerticalPanel
Re: Gears GWT API on Android behaving differently?
What is the exact Java code snippet that you are using? On Thu, May 7, 2009 at 10:10 PM, Evan Ruff evan.r...@gmail.com wrote: Vitali, I was just trying to match '?' in the SQL statement, such as: INSERT into users ( name, city ) VALUES( ?, ? ) so I can mash up my own prepare SQL statement. Also, I can run the test on the android phone to see if that might be the problem. E On May 7, 4:36 pm, Vitali Lovich vlov...@gmail.com wrote: What's the code for the regexp that you are trying what is the source string that you are matching against. On Thu, May 7, 2009 at 3:24 PM, Evan Ruff evan.r...@gmail.com wrote: Vitali, Thanks for your response! That RegExp for the ? was giving me trouble, as it wouldn't match. I also tried [\\?] without success as well. Any idea on how to find that guy? Thanks, E On May 7, 2:59 pm, Vitali Lovich vlov...@gmail.com wrote: Javascript Java have different regular expressions, so if you are running your stuff on desktop browsers in Hosted Mode but compiled mode in Android, then you might be running into that problem. A performance improvement should be: String statement = new String( sqlStatement ); StringBuffer sb = new StringBuffer(statement.length()); int index; int previous = 0; int i = 0; while ((index = statement.indexOf('?')) != -1) { String firstPart = statement.substring( previous, index ); sb.append (firstPart).append('').append(params[i++]).append(''); previous = index + 1; } return sb.toString(); or try String statement = new String( sqlStatement ); String [] parts = statement.split([?]); StringBuffer sb = new StringBuffer(statement.length + parts.length * AVERAGE_PARAM_LENGTH); for (int i = 0; i parts.length; i++) { sb.append(parts[i]).append('').append(params[i]).append('') } AVERAGE_PARAM_LENGTH can be anything, but you want the resultant expression to be as close as possible to the actual final length as possible, without going under (assuming this portion of code is your hotpath - otherwise, you won't notice the difference). On Thu, May 7, 2009 at 2:12 PM, Evan Ruff evan.r...@gmail.com wrote: Ok so something really fishy is going on with the Gears API. I created my own prepareSQLStatement that converts the SQL Call and parameter list into a string. private String prepareSQLStatement( String sqlStatement, String[] params ) throws DatabaseException { try { String statement = new String( sqlStatement ); for ( int i = 0; ( statement.indexOf( ? ) 0 ); i++ ) { int index = statement.indexOf( '?' ); String firstPart = statement.substring( 0, index ); String secondPart = statement.substring( index + 1 ); StringBuffer sb = new StringBuffer(); sb.append( firstPart ).append( \ ).append( params[ i ] ).append ( \ ).append( secondPart ); statement = sb.toString(); } return statement; } catch ( IndexOutOfBoundsException indexOut ) { throw new DatabaseException( Index out of bounds. SQL Parameter Error ); } } When I use this method to prepare the statement before hitting db.execute, all of my sql statements work as expected. Could Android implement it's string manipulation stack slightly differently than all the other platforms? I've got a sneaky suspecion that the RegExp that's used to parse the '?' in the SQL commands might be failing? Furthermore, can anyone give me an ideas as how to improve the performance of the above method? It creates a noticable delay. Did I read somewhere that GWT has a slow string manipulation engine? E On May 6, 2:07 pm, Evan Ruff evan.r...@gmail.com wrote: Hey Eric, I'm pretty much terrified of Javascript. I'm a little hesitant to make any determination whatsoever as to the cause of the problem. When I run the GWT Gears Sample DatabaseDemo project, it works as expected. I can even replace all of the DB specifics with the internals of my tables/queries and it seems to work! It's just so freakin' frustrating. RememberTheMilk and the mobile GMail seem to make use of Gears on Android without issue, so I really don't know where to go from here. Any other suggestions
Re: Eclipse Plugin Compile Button Stack Overflow
On Thu, Apr 30, 2009 at 10:25 AM, mounier.flor...@gmail.com mounier.flor...@gmail.com wrote: I'm waiting for it too and its starting to take time just for two options... Why does deploying force compilation (which fails so badly) ? Because that's what deployment is? Maybe I'm not understanding your question. Hosted mode (which runs the Java code in a JVM) is just for debugging. For deployment, you compile the Java code into actual Javascript. BTW what does it change to use GWT trunk ? From what I could tell, not much. But there could be more unknown bugs whatnot. However, it should compile - according to the Google developers, they have other internal teams working against trunk. I'm using it and I still have the issue... (and I can't deploy and oophm doesn't have a compile button yet, fortunately i can compile with ant) So what's the issue? What do you mean you can't deploy? You just said you can compile with ant. OOPHM should get the compile button eventually - I never found a particular need to use it. Just run your ant script. On 23 avr, 15:59, Miguel Méndez mmen...@google.com wrote: We've updated the compile UI to allow you to tweak the -Xss and -Xmx settings. It will be part of the upcoming point release of the plugin. In the meantime, the compile button in hosted mode is one work around. You can also compile a version of the GWT trunk and have the plugin use that SDK for the project. On Thu, Apr 23, 2009 at 3:51 AM, mihai007 mihai@gmail.com wrote: oh well add me to the list. this should have priority as it turns the use of plugin useless if I can't compile any workarounds? On 8 Abr, 16:11, Brian hibr...@gmail.com wrote: Just installed the Google plugin for Eclipse, and hit the Compile button on my project. It gave me astackoverflowerror. Prior to using the plugin, I'd compile by hitting the Compile button in the hosted mode browser. In the Run/Debug Eclipse configuration, I have -Xss4k -Xmx256M Compiles worked fine with those flags and the Compile button from hosted mode. How do I set the Xss flag for use by the Compile button in the eclipse toolbar? I tried putting it in the Advanced section, but this just informed me it wasn't an appropriate gwt compiler option. This isn't stopping me from doing anything, as I can still compile from hosted mode, just curious how to set it up. I checked the plugin faq, but couldn't find anything there. -- Miguel --~--~-~--~~~---~--~~ 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: Asynchronous communication from server to client
*Coding style*: Several things. Why aren't your state variables part of an enum? Why aren't you using a switch statement instead of 10 if/else ifs. *Architecture*: Why are you using a timer that will do nothing most of the time? You're just putting load on the client unnecessarily. Why are you even using an explicit state machine? With the example below you can easily chain RPC calls together by putting the appropriate function call in the onSuccess. This way, you're not needlessly executing code that does nothing every 100milliseconds. You are also getting 0 latency between states (thus better performance). Stay away from timers unless you are doing animation or actually need a periodic task. DO NOT USE IT TO SIMULATE AN EVENT LOOP (not yelling - just an important point to keep in mind). package com.test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; public class GWTProcess implements EntryPoint { String result1 = ; String result2 = ; private static final class LazyWebService { public static final WebServiceOneAsync webservice = GWT.create (WebServiceOne.class); } public void onModuleLoad() { initialize(); buildGui(); } private void initialize() { // nothing to do } private void buildGui() { Button b = new Button(Click me, new ClickListener() { public void onClick(Widget sender) { Window.alert(start data load); fireWebServiceOne(); } }); RootPanel.get().add(b); } private void displayData() { Window.alert(result1+:+result2); } private void fireWebServiceOne() { AsyncCallbackString callback = new AsyncCallbackString() { public void onFailure(Throwable caught) { Window.alert(ERROR READING WEBSERVICE); } public void onSuccess(String results) { results1 = results; fireWebServiceTwo(); } }; LazyWebService.webservice.getData(callback); } private void fireWebServiceTwo() { AsyncCallbackString callback = new AsyncCallbackString() { public void onFailure(Throwable caught) { Window.alert(ERROR READING WEBSERVICE); } public void onSuccess(String results) { results2 = results; displayData(); } }; LazyWebService.webservice.getData(callback); } } On Thu, Apr 30, 2009 at 9:22 AM, devcybiko devcyb...@gmail.com wrote: I've started using timers combined with a state/transition matrix. I've offered a simple example below. The basic idea is to keep a 'state' variable with the current state in the program logic. When you initiate a asynchronous call, you move the state to LOADING. When the call is complete, you move the state to RUNNING. You can easily chain requests (as in the example) by pushing the state from LOADING_WS1_DATA to DONE_LOADING_WS1_DATA to LOADING_WS2_DATA to DONE_LOADING_WS2_DATA finally back to RUNNING. Example follows: package com.test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; public class GWTProcess implements EntryPoint { private static final int ERROR = -2; private static final int INIT = -1; private static final int RUNNING = 0; private static final int BUILD_GUI = 100; private static final int START_LOADING_DATA = 200; private static final int LOADING_WS1_DATA = 300; private static final int DONE_LOADING_WS1_DATA = 301; private static final int LOADING_WS2_DATA = 400; private static final int DONE_LOADING_WS2_DATA = 401; private static final int DISPLAY_DATA = 500; int state = INIT; String result1 = ; String result2 = ; public void onModuleLoad() { Timer t = new Timer() { public void run() { if (state == INIT) { initialize(); state = BUILD_GUI; } else if (state == BUILD_GUI) { buildGui(); state =
Re: How to use PRETTY from Hosted Mode?
No - the hosted mode compilation is just a shortcut (I don't even understand the reason for it being there). For complete control over the compiler, you have to invoke it from the cmd line. On Thu, Apr 30, 2009 at 4:56 AM, olel lauri...@engram.de wrote: Hi, is there a way to tell the Hosted Mode that it should generate the javascript in the PRETTY mode? I know that I can change it in the compile.cmd, but the will not effect the hosted mode compiler, will it? Thanks in advance, Ole --~--~-~--~~~---~--~~ 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: How to use PRETTY from Hosted Mode?
Are you sure HostedMode actually passes on those options to the compiler? It might just ignore them. On Thu, Apr 30, 2009 at 12:35 PM, Gilles B gilles.broch...@gmail.comwrote: Inside Eclipse I run the hosted mode with the com.google.gwt.dev.HostedMode main class. (Run Configurations..) in your program argument you can specify this option: -startupUrl myproject.html com.gbr.Activity -style DETAILED or -startupUrl myproject.html com.gbr.Activity -style PRETTY it it used with your compile/browse button from local console and generate the good java script style in your war directories. Gilles. --~--~-~--~~~---~--~~ 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: Image Bundle fails in GWT 1.6 hosted mode and IE
HostedMode is IE (on Windows), so that wouldn't be surprising. On Thu, Apr 30, 2009 at 2:27 AM, Rafiq rafiq...@gmail.com wrote: But first even in GWT 1.6 hosted mode itself, it blows up. These are normal size images done for a slide show. On Apr 29, 7:02 pm, Thomas Broyer t.bro...@gmail.com wrote: On 29 avr, 13:59, Rafiq rafiq...@gmail.com wrote: While I expected Image bundle to improve my home page loading experience, it blows up both in GWT 1.6 hosted mode and IE. When i Googled it, It seems, this is an age old problem with GWT and it is recurring again. AFAICT, this won't be the case anymore in the next 1.6.x release in IE7 and IE8 (will still be an issue in IE6). ...though it depends which problem you're facing (there's also the IE limitation about the width of the image bundle, I don't know if it'll go away with the removal of AlphaImageLoader for IE7+) --~--~-~--~~~---~--~~ 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: Can't run a batch
Why not just step through the code in a debugger? Put breakpoints on both ends of the RPC call go from there. On Wed, Apr 29, 2009 at 9:59 AM, Ian Bambury ianbamb...@gmail.com wrote: The thing is, you have to work out where the failure is happening. If you know that the batch file isn't being called, then it must be failing before that (by 'failing' I don't just mean error, but include logic errors that mean things don't get called). Personally, I'd put an alert in the routine that does the RPC call just before you make the call. If you see that, then you can start checking the server-side code, if you don't then you can move the alert back from the RPC until you find a place where it is actually executed and see what is going wrong there. It *might* be a GWT problem, but you really need to determine what is going wrong and where. A batch file not running on the server is more likely to be a logic error (therefore a 'Java programming' problem rather than a GWT problem.) Ian http://examples.roughian.com 2009/4/29 Scientist ma...@gl-power.nl My experience is very little, my source for checking is the batch file self. In NetBeans, the batch gets executed perfectly. The batch is used to convert a .csv file into a .xls, and delete the .csv. I just can't imagine why the batch would be the problem if it runs well in another development enviroment. On Apr 29, 1:36 pm, Ian Bambury ianbamb...@gmail.com wrote: OK. I don't know how much experience you have, but my first question would be: How do you know it hasn't run - i.e. where do you look for a result? Ian http://examples.roughian.com 2009/4/29 Scientist ma...@gl-power.nl On Apr 29, 1:08 pm, Ian Bambury ianbamb...@gmail.com wrote: Why do you think this is related to GWT? Ian Cause it's working perfectly in Netbeans, and the compile gives no errors. http://examples.roughian.com 2009/4/29 Scientist ma...@gl-power.nl Hi guys, I have a REALLY strange problem. This is the function I have: public static void generateXLS() { try { String[] command = { cmd.exe, /C, Start, C:// exports//convert.bat }; Process p = Runtime.getRuntime().exec(command); BufferedReader in = new BufferedReader( new InputStreamReader(p.getInputStream ())); String line = null; while ((line = in.readLine()) != null) { System.out.println(line); } } catch (IOException e) { e.printStackTrace(); } } This is written on the serverside. The function is fired by a previous function, that works. The batch won't trigger for some reason, though. The strangest part is: when I copy/paste the same code in NetBeans, it works perfect. I've already tried this line instead of above: String[] command = { cmd.exe, /C, Start, C:\\exports\\convert.bat }; without any result. I'm not getting compiling errors, it just won't trigger the batch while executing the application. I'm using Eclipse, GWT and Maven. Please help!!!- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 Incubator usage
I'm pretty sure that incubator is linked to the latest build, not trunk. It includes a bunch of stuff that, AFAIK, is targeted for inclusion at some point in the future in trunk. As for use in real projects, it's up to you. Probably the incubator mailing list would be a better place to ask. On Wed, Apr 29, 2009 at 12:46 PM, Satya Bobba nasbo...@yahoo.com wrote: is it good to use the incubators in the real projects. Incubators are not stable and also it is strictly linked with latest compiler. is it correct. --~--~-~--~~~---~--~~ 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: Google Calendar embeded in my webapp
I'm building something like that, but no, there's no official Google calendar. You can try http://code.google.com/p/ftr-gwt-library/. It has a Google Calendar look-alike. It is kind of a pain to use though there are some bugs. On Wed, Apr 29, 2009 at 11:20 AM, LFCPD laieta.hip.hop...@gmail.com wrote: Hi all, I'd like to embed a google calendar into my webapp. Is it possible? The server side of my webapp will add/remove events from that google calendar and anything else. Does exist some Google Calendar widget? thanks you all! --~--~-~--~~~---~--~~ 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: Porting onEventPreview to 1.6's onPreviewNativeEvent...
That's really strange that you couldn't add a widget to the DOM within the preview event handler - I can't think of a reason why it would prevent you from doing that. I agree - it's really hard to find an actual definitive reference guide for the DOM model what kind of stuff you are aren't allowed to do. MDC https://developer.mozilla.org/En has some good info examples, but it's fairly Firefox specific (it'll usually be correct for other browsers, but it'll be annoying when it's not). On Wed, Apr 29, 2009 at 10:47 AM, Gavin Andresen gavinandre...@gmail.comwrote: For anybody trying to do something similar, my working code (using event.preventDefault, and using DeferredCommand did the trick): // // Preview events-- look for shift-clicks on paper/author links, and pops up // edit dialog boxes: // public void onPreviewNativeEvent(Event.NativePreviewEvent pe) { NativeEvent e = pe.getNativeEvent(); if (Event.getTypeInt(e.getType()) != Event.ONCLICK) { return; } if (!e.getShiftKey()) { return; } EventTarget target = e.getEventTarget(); if (!Element.is(target)) { return; } Element elt = Element.as(target); String href = elt.getAttribute(href); if (href == null || href.length() == 0){ return; } if (href.contains(/paper/)) { e.preventDefault(); final String paperPID = InterfaceUtils.getPIDFromLinkString (href, paper/); DeferredCommand.addCommand(new Command() { public void execute() { fetchPaperInfoThenEdit(paperPID); } }); } else if (href.contains(/author/)) { e.preventDefault(); final String authorPID = InterfaceUtils.getPIDFromLinkString (href, author/); MapString,String params = InterfaceUtils.parseURLParams(href); final String fromPaperPID = params.get(fromPaper); DeferredCommand.addCommand(new Command() { public void execute() { fetchAuthorInfoThenEdit(authorPID, fromPaperPID); } }); } } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[gwt-contrib] Re: IE8 support
That's annoying. On Wed, Apr 29, 2009 at 1:07 PM, Joel Webber j...@google.com wrote: Not even close, unfortunately. If you look at the wiki page I wrote up: http://code.google.com/p/google-web-toolkit/wiki/IE8Support You'll see that the actual differences are pretty minimal. They fixed a number of CSS things, added DOM storage, Ajax history, and other things like that. But their event model is still wildly different. Most of the DOM element methods and properties are still weird and different, and so forth. I'm afraid Trident remains its own beast :( On Wed, Apr 29, 2009 at 1:02 PM, Vitali Lovich vlov...@gmail.com wrote: Does IE8 still have non-standards compliant behaviour? I thought they were supposed to introduce pretty strict standards compliance with IE8 (in fact, some/all? legacy non-standard stuff is unavailable). Shouldn't IE8 extend DOMImplStandard or are there still remaining issues? On Mon, Apr 27, 2009 at 11:22 AM, j...@google.com wrote: http://gwt-code-reviews.appspot.com/29803/diff/1/5 File user/src/com/google/gwt/dom/DOM.gwt.xml (right): http://gwt-code-reviews.appspot.com/29803/diff/1/5#newcode56 Line 56: when-property-is name=user.agent value=ie6/ On 2009/04/24 20:34:56, jlabanca wrote: too many spaces Done. http://gwt-code-reviews.appspot.com/29803/diff/1/12 File user/src/com/google/gwt/user/Form.gwt.xml (right): http://gwt-code-reviews.appspot.com/29803/diff/1/12#newcode31 Line 31: when-property-is name=user.agent value=ie6/ On 2009/04/24 20:34:56, jlabanca wrote: Spacing, and what are those two red arrows? »» visual tab indicators. Cleaned up tabs. http://gwt-code-reviews.appspot.com/29803/diff/1/7 File user/src/com/google/gwt/user/RichText.gwt.xml (right): http://gwt-code-reviews.appspot.com/29803/diff/1/7#newcode27 Line 27: when-property-is name=user.agent value=ie6 / On 2009/04/24 20:34:56, jlabanca wrote: Remove the »», which I assume are tabs. Done. http://gwt-code-reviews.appspot.com/29803/diff/1/8 File user/src/com/google/gwt/user/TextBox.gwt.xml (right): http://gwt-code-reviews.appspot.com/29803/diff/1/8#newcode32 Line 32: when-property-is name=user.agent value=ie6/ On 2009/04/24 20:34:56, jlabanca wrote: Remove »» Done. http://gwt-code-reviews.appspot.com/29803/diff/1/9 File user/src/com/google/gwt/user/UserAgent.gwt.xml (right): http://gwt-code-reviews.appspot.com/29803/diff/1/9#newcode38 Line 38: if (v = 8000) { On 2009/04/24 23:44:41, t.broyer wrote: I believe ie8 here means X-UA-Compatibility: IE=8, so detecting the version from the navigator.userAgent is probably not enough [1], and document.documentMode should be used instead [2], otherwise the ie8 implementation would have to do a quirks-vs-standards-vs-super-standards-mode-detection, which would make the ie6 impl quite useless. [1] Mike Ormond reports that a document can be displayed in IE=5 or IE=7 mode while the UA is still reported as MSIE 8.0 http://blogs.msdn.com/mikeormond/archive/2008/09/25/ie-8-compatibility-meta-tags-http-headers-user-agent-strings-etc-etc.aspx [2] http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx#GetModehttp://msdn.microsoft.com/en-us/library/cc288325%28VS.85%29.aspx#GetMode Thanks for pointing out that blog in particular. Amazing that they managed to turn quirks/standards into a 12-entry matrix :P The good news is that In compatibility view, IE always reports its UA as MSIE 7.0, which triggers the ie6 user-agent property. When no X-UA-Compatible header is set, we're in normal mode (i.e., not compatibility view), and no DOCTYPE is set, we end up in quirks-mode, which appears to turn off some IE8 features (I've noticed that at least IE8 history breaks, though everything else I've tried seems to work fine and all of our tests pass). The only solution I'm aware of is to either set a DOCTYPE or the X-UA-Compatible header (both of which will put you in standards-mode). I realize there are still some GWT panels that layout a bit oddly in standards-mode, and while we're working on solving this, it's going to be a problem for some apps for a while yet. I'll document this on the IE8 support wiki page for now. Before long, it will be the right thing to always set a DOCTYPE, which should make this problem go away. http://gwt-code-reviews.appspot.com/29803/diff/1/6 File user/src/com/google/gwt/xml/XML.gwt.xml (right): http://gwt-code-reviews.appspot.com/29803/diff/1/6#newcode39 Line 39: when-property-is name=user.agent value=ie6/ On 2009/04/24 20:34:56, jlabanca wrote: tabs again »» Done. http://gwt-code-reviews.appspot.com/29803 --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
Re: Wait for all asynchronous calls to finish
No just DOM events. Like I said, just disable the UI screen (i.e. popup a modal dialogbox) until the RPC completes one way or another. That's by far the simplest solution I can think of. More complicated ones would involve grouping forms specifying which are incompatible. Then a framework would take care of disabling input on conflicting forms that have pending RPC. This would allow the user to do as much as possible without having to potentially wait for the server. You can always just ignore RPC calls if (someStaticGlobalVariable allowedNumberOfRPCCalls) { someStaticGlobalVariable++; myService.rpcCall(new AsyncCallback() { onFailure() { someStaticGlobalVariable--; } onSuccess() { someStaticGlobalVariable--; } }); } the problem with that approach though is that if you don't disable user input, the user will get frustrated wondering why they're clicking but the web-app isn't doing anything. So disabling gives the user an indication of what is going on ensures that multiple RPC calls don't happen. At the very least, just disable the widget that initiates the RPC action (if you want to allow the user to continue editing data while the RPC is in progress). On Tue, Apr 28, 2009 at 12:55 AM, AirJ di.z...@gmail.com wrote: Sorry, Wait may have a misnomer here. I don't mean to have browser block waiting for the asynchronous calls to finish. What I mean is, before launching another asynchronous call, flush out the AsyncCallbacks in the stack. In a complicated UI screen, when saving the record, each field may go through different validation asynchronous calls. Saving the record without waiting for the previous asynchronous calls to finish will result in unpredictible behavior. For example, validation may change some record value. If save is invoked before validations are finished, old values may be saved. I thought DeferredCommand.addCommand() would serve the purpose. From the javadoc Enqueues a Command to be fired after all current events have been handled. Note that the Command should not perform any blocking operations. I am wondering if the events include asynchronous calls, or are they just referring to DOM events. On Apr 27, 6:41 pm, Vitali Lovich vlov...@gmail.com wrote: No. Waiting in the browser means it freezes it (remember - single threaded). Why not just disable the input fields that can lead to an RPC call ( some kind of processing indicator so the user understands what's going on) reenable them when the call completes. Just apply a proper MVC pattern you'r code should be clean (i.e. your controller will disable the view when the model is busy updating the backend reenable it when the model indicates it is finished). On Mon, Apr 27, 2009 at 8:33 PM, AirJ di.z...@gmail.com wrote: Hi GWT gurus, I have a generic questions regarding asynchronous calls. Basically in our gwt web application, when user clicks on save button, the application launches a bunch of asynchronous calls(validation, server side callbacks). Save should only be invoked when all those asynchronous calls are processed. One way to do it is to call Save in the onCallbackSuccess() method of those asynchronous calls. But it will make the code very unstructured and hard to trace. Essentially I need a method to flush all the queued asynchronous calls before I make a new one. Will DeferredCommand.addCommand() solve the problem? Thanks, Di --~--~-~--~~~---~--~~ 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 1.6.4 compatibility with IE 6, 7 and 8
Using only pure GWT, I find it hard to imagine their being an exception only in web mode on a specific browser unless it's a bug. Are you using any third-party libraries? Can you please supply the exact code snippet that reproduces this? On Tue, Apr 28, 2009 at 12:10 PM, xsegrity xsegr...@gmail.com wrote: Have you tried compiling in PRETTY or DETAILED mode and then see what the error is? You should try this first if you haven't already. When it fails, the browser will give a line # which you can then use to find where in the js file it is having the issue. Without knowing the specific problem though I can't give any advice on how to fix it. On Apr 28, 9:17 am, Ben benzhe...@gmail.com wrote: Really?! That sounds quite unreasonable as GWT is Java based. I thought it would make no difference which environment you develop. I will try to run it on Windows. Thanks, On Apr 28, 7:26 am, Ed post2edb...@hotmail.com wrote: I would also recommend developing on Windows (running hosted mode). I remember that one of our developers did his best developing on his mac, but gave up after some time - Ed --~--~-~--~~~---~--~~ 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: Wait for all asynchronous calls to finish
Here's my approach when designing something like that. Any validation should happen immediately client side since that is one of the major benefits of using AJAX. Doing an RPC call every time a field loses focus is pretty inefficient - I think doing it this way is too easy to make it a crappy experience for your users (now if the validation needs to access some kind of resource that isn't available from the sandbox, that's a different story, although that doesn't seem like a validation that should happen instantly). In fact, if you do it right, you can share most (if not all) the validation code between client side server side. Then when the user presses save, the data is sent off to be saved at which points it gets actually validated (once) on the server. This approach has the following benefit: Lower server load - you're not making multiple RPC calls to process 1 form. Lower client load - you're not making multiple RPC calls to process 1 form Better user experience - validation happens instantly instead of requiring a round trip to the server. Also, what happens if the server happens to be down at that particular moment? Handling the failure of 1 RPC point is much easier conceptually than multiple. Remember - RPC calls cost in terms of processing power (2 times serialization deserialization) bandwidth. To top it all off, if this is a form that has some kind of save button anyways, you are going to double the amount of validation you need to do - once when the user enters the data all over again when they hit save. So the architecture for your program is not taking advantage of what Javascript offers which is to offload work that the client can do. Anything everything that can be done by the user, should be done with the server doing minimal work being stateless. The server should, IMHO, be a dumb machine that just processes requests responses immediately. All state goes to the client, persistance goes to the database. The validation is a small little layer of business logic that sits between the servlet persistance layers to ensure valid data, permissions, etc. If any state information is needed for the server, then the client is responsible for supplying it (of course you need to be aware of validating this too - depending on the application, you may want to keep track of the state in the DB. In all my apps I've been able to architecture it so the state was not important for the server, but that isn't saying much). On Tue, Apr 28, 2009 at 2:44 PM, AirJ di.z...@gmail.com wrote: Thanks for all the help. Vitali, I cannot simply disable the save button since our field validation happens when field loses focus. If I disable Save button, user will be confused. Jason, yes, I do have a similar AsyncCommand package that does the command chaining. The problem is, our UI is driven by metadata. The logic is prettty complicated at the client side. Even chaining commands are making the code convoluted. Denly, thanks for the suggestion. I finally decided to follow your advice and implemented our own flush mechanism. It works perfectly! On Apr 28, 7:43 am, Jason Essington jason.essing...@gmail.com wrote: So, you click save, then each field is validated individually via an RPC? One trick is to chain your RPC Calls. I have an abstract Callback that implements Command and also has a field to hold an additional Command. CommandCallback the execute() method is able to Fire the RPC that is handled by the callback, and after onSuccess() is processed any command added to the callback is executed (another commandCallback for instance) that way you can create a whole chain of RPCs and call execute on the first and each will be sent in sequence. to prevent the save button from being pressed again while these RPCs are executing you can disable the button, and enable it again as a final command in the chain. Of course, if you can combine all of these RPCs into a single request you'll have better performance. -jason On Apr 27, 2009, at 6:33 PM, AirJ wrote: Hi GWT gurus, I have a generic questions regarding asynchronous calls. Basically in our gwt web application, when user clicks on save button, the application launches a bunch of asynchronous calls(validation, server side callbacks). Save should only be invoked when all those asynchronous calls are processed. One way to do it is to call Save in the onCallbackSuccess() method of those asynchronous calls. But it will make the code very unstructured and hard to trace. Essentially I need a method to flush all the queued asynchronous calls before I make a new one. Will DeferredCommand.addCommand() solve the problem? Thanks, Di --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to
Re: A widget that has an existing parent widget may not be added to the detach list
Yes. Use GWT properly. Don't use raw HTML. That's your problem. Instead of adding an HTML widget that wraps a div, use a SimplePanel set it's id if you need to. Look at the showcase - it shows you a brief overview of most (all?) the widgets GWT has. Think of using raw HTML in your app as something akin to JSNI - only do it if you know what you are doing, otherwise you're just going to shoot yourself in the foot. The only time raw HTML is commonly used is in the constructor of some Widgets (you'll see a boolean asking if you want to treat the string as text or html). The rule of thumb to use is as follows: HTML element | v wrapping GWT root panel | v GWT widgets panels | v HTML possible Do not put GWT widgets below HTML possible. Do not wrap HTML possible in GWT widgets. HTML element can have sibling elements that get wrapped with GWT. Hopefully this'll clarify it for you. On Tue, Apr 28, 2009 at 4:52 AM, kohlyn co...@solas.net wrote: Any suggested workarounds? I currently load a page layout in HTML (Header/Menu Bar/Footer) ... then in each section I load different HTML layouts depending on the user, and then I add the controls. On Apr 27, 6:15 pm, Vitali Lovich vlov...@gmail.com wrote: Yes this has already come up on the mailing list. This was always illegal, just uncaught prior to 1.6. You cannot wrap two elements in GWT if they already have a parent/child relationship in the DOM (causes a mismatch in the trees). Do a search you'll find the response from the GWT developer regarding this issue. On Mon, Apr 27, 2009 at 11:12 AM, kohlyn co...@solas.net wrote: I'm getting the following errors with 1.6.4 on a Mac. A widget that has an existing parent widget may not be added to the detach list The HTML is: body !-- OPTIONAL: include this if you want history support -- iframe src=javascript:'' id=__gwt_historyFrame tabIndex='-1' style=position:absolute;width:0;height:0;border:0/iframe h1Web Application Starter Project/h1 div id=testdiv/div /body Code: public void onModuleLoad() { HTMLPanel p = new HTMLPanel(div id=\testdiv2\Test Div 2/ div); RootPanel.get(testdiv).add(p); final TextBox txtUsername = new TextBox(); RootPanel.get(testdiv2).add(txtUsername); } } This code worked in the 1.4 and 1.5 branches, but not 1.6. The line: RootPanel.get(testdiv2).add(txtUsername); throws the exception. A widget that has an existing parent widget may not be added to the detach list The problems appears to be with a new check in RootPanel.detachOnWindowClose(Widget widget) assert !isElementChildOfWidget(widget.getElement()) : A widget that has + an existing parent widget may not be added to the detach list; RootPanel.isElementChildOfWidget(Element element) appears to fail because I'm adding a widget to an already attached element. Any work arounds/ideas would be greatly appreciated ... I have a 1.4 application that is based on dynamically loading page layouts from a database. Thanks. --~--~-~--~~~---~--~~ 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: Identifying what css are loaded
On Tue, Apr 28, 2009 at 2:21 AM, jagadesh jagadesh.manch...@gmail.comwrote: so how can i check which css file is loaded , ot there any way to check whether perticular css file has been loaded . This is more of a JS question - last post in http://groups.google.com/group/jquery-en/browse_thread/thread/633b3b996b0ed2f1?pli=1. Try that solution (you'll need JSNI - refer to https://developer.mozilla.org/en/DOM/document.styleSheets for the JS object definition) --~--~-~--~~~---~--~~ 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 1.6.4 compatibility with IE 6, 7 and 8
By the way, there's no point in setting up a machine to test out on Windows. Just run it in a VM. That way you can also throw it between developer machines if problems come up. On Tue, Apr 28, 2009 at 10:31 PM, Ben benzhe...@gmail.com wrote: It is pure GWT. I have quite a few codes and I will organize and clean them up. Will post the code snippet soon. Thanks in advance. -Ben On Apr 28, 12:42 pm, Vitali Lovich vlov...@gmail.com wrote: Using only pure GWT, I find it hard to imagine their being an exception only in web mode on a specific browser unless it's a bug. Are you using any third-party libraries? Can you please supply the exact code snippet that reproduces this? On Tue, Apr 28, 2009 at 12:10 PM, xsegrity xsegr...@gmail.com wrote: Have you tried compiling in PRETTY or DETAILED mode and then see what the error is? You should try this first if you haven't already. When it fails, the browser will give a line # which you can then use to find where in the js file it is having the issue. Without knowing the specific problem though I can't give any advice on how to fix it. On Apr 28, 9:17 am, Ben benzhe...@gmail.com wrote: Really?! That sounds quite unreasonable as GWT is Java based. I thought it would make no difference which environment you develop. I will try to run it on Windows. Thanks, On Apr 28, 7:26 am, Ed post2edb...@hotmail.com wrote: I would also recommend developing on Windows (running hosted mode). I remember that one of our developers did his best developing on his mac, but gave up after some time - Ed --~--~-~--~~~---~--~~ 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: Deployment of default GWT application.
On Mon, Apr 27, 2009 at 4:51 AM, newtoGWT ganesh@gmail.com wrote: Did you test your application in hosted mode? try debugging it in the hosted mode.. That kind of defeats the whole deployment aspect of his question. This only helps if you need to debug an error in your application logic, not configuration or integration (I'm assuming that he's already done this since he talks about deployment to apache). On Apr 27, 2:38 am, Dan King dankin...@gmail.com wrote: Hi there, Can anyone give me any instructions on how to deploy the default GWT application. I have successfully gotten the client to appear properly in the browser by reference it as a website in Apache. The problem I am getting is when I click Send to send the name to the server I receive a Remote Procedure Call - Failure message. I'm not sure what I need to do. Any help is greatly appreciated as I am new to web development and GWT. Apache is an HTTP server. RPC requires a Java servlet (i.e. served by something like Tomcat, JBoss, Glassfish, etc). Are you properly integrating the two? Typically, AFAIK, you use your Java servlet server to also serve the HTML. I have no experience with deployment of this kind, so I dunno (I'm assuming that it is possible to integrate Apache + some Java server - I don't even have a clue either way). Thanks --~--~-~--~~~---~--~~ 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: Question: Portlet JSR 286 Support for GWT
You may want to examine http://www.gwtportlets.org/ first. It's not the JSR (name collision is due to convenience, not relation), but it may have what you want. On Mon, Apr 27, 2009 at 4:20 AM, Nail Ünlü nail.uen...@gmail.com wrote: Hiho, Im in the process to evaluate the JSR 286 Portlet specification support of GWT and have some questions that you guys could maybe answer :-) The evaluation takes place in the IBM Websphere Portal portlet. 1. As someone can have several portlets put on one page, how can someone handle the namespace issues inside the same page? Using portlet:namespace/ in the JSP is not an option as the client code (with Javscript) is generated. So how can i ensure that my javascript for each portlet has unique namings, my DIV's etc. in my portlet are name unique (e.g to avoid that one portlet can change the visibility of another portlets DIV, as they are named the same way) ? If all developers use your library at one point all widgets go through your library, then you can guarantee the div gets the namespace somehow added to the ID. 2. How can i respect the different Phases of a JSR 286 portlet with GWT?Im totally aware that with the Asynchronous communication, the processAction-Method becomes obsolete...but how do you handle the situation, where a Portlet calls your portlet through a ActionURL ? How do you process the request and do your action? I'm not familiar with the JSR (wonder how many people here are). Can you expand on the requirement? 3. How does the interportlet communication, which is specified in JSR 286 work? Im aware that there are possibilities to do it between GWT enabled-Portlets through AJAX but how do you communicate with a non- GWT-Portlet that DOES support JSR 286 render parameter functionality? Please clarify the requirement here. It's possible to do some level of communication between GWT modules that are on 1 page. Not trivial, but possible (but I believe they would have to expose some kind of non-conflicting interface, in terms of the function name), but these apps would have to be created to begin with with the expectation of being used as a JS library. However, making a GWT-enabled-Portlet can just be a simple inherits away. --~--~-~--~~~---~--~~ 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: A widget that has an existing parent widget may not be added to the detach list
Yes this has already come up on the mailing list. This was always illegal, just uncaught prior to 1.6. You cannot wrap two elements in GWT if they already have a parent/child relationship in the DOM (causes a mismatch in the trees). Do a search you'll find the response from the GWT developer regarding this issue. On Mon, Apr 27, 2009 at 11:12 AM, kohlyn co...@solas.net wrote: I'm getting the following errors with 1.6.4 on a Mac. A widget that has an existing parent widget may not be added to the detach list The HTML is: body !-- OPTIONAL: include this if you want history support -- iframe src=javascript:'' id=__gwt_historyFrame tabIndex='-1' style=position:absolute;width:0;height:0;border:0/iframe h1Web Application Starter Project/h1 div id=testdiv/div /body Code: public void onModuleLoad() { HTMLPanel p = new HTMLPanel(div id=\testdiv2\Test Div 2/ div); RootPanel.get(testdiv).add(p); final TextBox txtUsername = new TextBox(); RootPanel.get(testdiv2).add(txtUsername); } } This code worked in the 1.4 and 1.5 branches, but not 1.6. The line: RootPanel.get(testdiv2).add(txtUsername); throws the exception. A widget that has an existing parent widget may not be added to the detach list The problems appears to be with a new check in RootPanel.detachOnWindowClose(Widget widget) assert !isElementChildOfWidget(widget.getElement()) : A widget that has + an existing parent widget may not be added to the detach list; RootPanel.isElementChildOfWidget(Element element) appears to fail because I'm adding a widget to an already attached element. Any work arounds/ideas would be greatly appreciated ... I have a 1.4 application that is based on dynamically loading page layouts from a database. Thanks. --~--~-~--~~~---~--~~ 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 1.6.4 compatibility with IE 6, 7 and 8
Have you run in hosted mode? On Windows it's a flavour of IE5 or IE6 (probably 6). IE8 support was added recently to trunk, so official support won't come out until the next version of GWT (unless they do a point release with support, although that seems unlikely). IE8 isn't even out yet. On Mon, Apr 27, 2009 at 12:15 PM, Ben benzhe...@gmail.com wrote: I am building an application with newest release of GWT on Mac OS. The whole app is in GWT, no JSNI and the structure of the application is sorta complicated. I have couple Composite widgets and some Composite widgets have references of other Composite Widgets. For example: A extends Composite { } B extends Composite { A a = new A(); public B (A instance_a) { this.a = instance_a } } And after compile and deployment, my application works fine in Firefox and Safari, but it has JS error on all IE 6, 7 and 8. And I did some debug by putting Window.alert(msg) in the end of Entry Point and I found out one of my composite widget causes the problem. Once I exclude it from Entry Point. The Window.alert is able to execute in IE 6,7 and 8. According to the documentation, GWT should have pretty good support for both IE 6 and 7. Does anyone have any idea what could be the possible reason for this kind of incompatibility? Thanks --~--~-~--~~~---~--~~ 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: client side data persistency
TreeMap is not a persistent store. Cookies are a persistent store. One way would be to serialize/deserialize from a string. Or store directly in cookies the key-value pairs encoded as strings. You may run into problems - there might be limits on the number of cookies a web site can have. It definitely has a limit on the size of each cookie, all cookies combined. They're also not trully persistent - for that you need HTML5 datastore support. It's based off of Google Gears (I'm pretty sure there's a library floating around that'll use HTML5 or Gears depending on what is available). HTML5 datastore support is Safari 4, FF 3.5, IE8. Not sure about Opera (I believe it's going to be 10.0). As you noted, Google Gears has platform issues on Linux (Browsers on Windows tend to be 32-bit even on 64-bit platforms). On Mon, Apr 27, 2009 at 11:40 AM, rocha.po...@gmail.com rocha.po...@gmail.com wrote: Hi all. I'm writing a GWT application where i would like to keep on the client side a generic metric store - a metric being composed by a date, a name, a value, and belonging to a domain (hierarchical, 'servicetype.servicename.blabla'). There are multiple remote sources for the metrics data, which are periodically queried so that the client store is kept up to date - using JSONP to allow cross site data querying. As a way to learn GWT i've written my own client side metric store, a good way to play and learn GWT's unit tests, benchmarks, etc. Now that this is done, i'm looking for a way to replace it with something standard :-) My implementation is not efficient and was done quickly using TreepMap(s), first keyed by Date and then by domain, as keys are sorted and i get a fast prototype running. But it's not the most flexible implementation. Do you have suggestions on libraries that will help me with this? I would love to use Gears, but it requires a plugin installation and i have clients using browsers in remote terminal services where the plugin won't be installed, and several others using x64 linux (i managed to install the plugin in my 64bit linux, but it seems to be an unofficial patch). Thanks a lot in advance, Ricardo --~--~-~--~~~---~--~~ 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: using synchronized rpc method?
Kind of remove the A out of AJAX. You can change any synchronous function call into an asynchronous RPC call. Remember, RPC calls might fail - you need to handle that case properly. You don't have that same problem with regular function calls. regular logic is // code preceding function call // function call // code after function call, potentially using result asynchronous logic is // code preceding function call // asynchronous function call with result handler result handler's onsuccess method processed with code after function call, potentially using result. result handler's onfailure method does appropriate error handling. This is a fundamental limitation of how AJAX is implemented because browser's are single threaded (otherwise you would lock up the UI waiting for a server response). On Mon, Apr 27, 2009 at 12:33 PM, jn93 j...@cornell.edu wrote: hi. i understand how to do asynchronous rpc calls from the client- side. is it also possible to use *synchronous* rpc calls? we have interface for it. --~--~-~--~~~---~--~~ 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: Problem with modifing files in www/com.mycompany.SToolS
As of 1.6, is a public directory recommended? I think everything just goes into the war directory (at least that's what webAppCreator does). On Mon, Apr 27, 2009 at 11:39 AM, Isaac Truett itru...@gmail.com wrote: Jan, www/ is an output directory. You shouldn't edit files in there. The static content source (HTML, CSS, etc.) will be in the public directory in your source tree next to your module definition file. - Isaac On Mon, Apr 27, 2009 at 4:25 AM, Janek liso...@wp.pl wrote: Hello everyone! I have created a GWT project in this way (MyProject = SToolS): mkdir MyProject cd MyProject projectCreator -eclipse MyProject applicationCreator -eclipse MyProject com.mycompany.client.MyApplication and now I have a lill problem with modifing files in the directory www/ com.mycompany.SToolS. First of all, when I recompile project (SToolS- compile) then they are all created from the beginning. But when I modifiy them (I tried to modify SToolS.css, SToolS.html) after SToolS- compile then the changed are not visible from the browser - the file is changed, when I open it with pico i.e. but when I enter that file through a web browser it is still the same. I tried it both before and after starting SToolS-shell. On the other hand, for experiment I tried to create a file in this directory (touch lala) and then it's accesible through the browser without any problem. Does anyone know how to alter these files? Cheers, Jan. --~--~-~--~~~---~--~~ 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 1.6.4 compatibility with IE 6, 7 and 8
No. I would recommend running in hosted mode on windows, although it's highly unlikely that'll solve anything (since any GWT code you write runs in the JVM anyways thus has no browser-dependant code outside of the GWT framework). Without knowing more about what the app is doing, it's hard to say - that code snippet should work. Can you supply the code for the entry point? On Mon, Apr 27, 2009 at 5:24 PM, Ben benzhe...@gmail.com wrote: Are you suggesting me to develop on Windows? My development environment is Mac OS X, but I do not think that is the reason why my app is not working on both IE 6 and IE 7 (I know GWT does not support IE 8 well for now). So for me, the hosted mode is Safari, but I have tested out on Safari on Mac, Firefox on Mac Firefox on Windows, all work. But it does not work at all on both IE 6 and IE 7. And as I said, my app is pure GWT, no JSNI and other stuff. Do you have any idea why it does not work on IE? Thanks, Ben On Apr 27, 1:20 pm, Vitali Lovich vlov...@gmail.com wrote: Have you run in hosted mode? On Windows it's a flavour of IE5 or IE6 (probably 6). IE8 support was added recently to trunk, so official support won't come out until the next version of GWT (unless they do a point release with support, although that seems unlikely). IE8 isn't even out yet. On Mon, Apr 27, 2009 at 12:15 PM, Ben benzhe...@gmail.com wrote: I am building an application with newest release of GWT on Mac OS. The whole app is in GWT, no JSNI and the structure of the application is sorta complicated. I have couple Composite widgets and some Composite widgets have references of other Composite Widgets. For example: A extends Composite { } B extends Composite { A a = new A(); public B (A instance_a) { this.a = instance_a } } And after compile and deployment, my application works fine in Firefox and Safari, but it has JS error on all IE 6, 7 and 8. And I did some debug by putting Window.alert(msg) in the end of Entry Point and I found out one of my composite widget causes the problem. Once I exclude it from Entry Point. The Window.alert is able to execute in IE 6,7 and 8. According to the documentation, GWT should have pretty good support for both IE 6 and 7. Does anyone have any idea what could be the possible reason for this kind of incompatibility? Thanks --~--~-~--~~~---~--~~ 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: Wait for all asynchronous calls to finish
No. Waiting in the browser means it freezes it (remember - single threaded). Why not just disable the input fields that can lead to an RPC call ( some kind of processing indicator so the user understands what's going on) reenable them when the call completes. Just apply a proper MVC pattern you'r code should be clean (i.e. your controller will disable the view when the model is busy updating the backend reenable it when the model indicates it is finished). On Mon, Apr 27, 2009 at 8:33 PM, AirJ di.z...@gmail.com wrote: Hi GWT gurus, I have a generic questions regarding asynchronous calls. Basically in our gwt web application, when user clicks on save button, the application launches a bunch of asynchronous calls(validation, server side callbacks). Save should only be invoked when all those asynchronous calls are processed. One way to do it is to call Save in the onCallbackSuccess() method of those asynchronous calls. But it will make the code very unstructured and hard to trace. Essentially I need a method to flush all the queued asynchronous calls before I make a new one. Will DeferredCommand.addCommand() solve the problem? Thanks, Di --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[gwt-contrib] Feature idea
Kinda like with GCC, allow detection of constant values (i.e. __builtin_constant_phttp://developer.apple.com/documentation/developertools/gcc-4.0.1/gcc/Other-Builtins.html). This way, you could do something like void addParameter (HashMap h, int size, String key, Object value) { if (GWT.isConstantValue(h, null)) { if (GWT.isConstantValue(size, 0)) size = 10; h = new HashMap(size); } h.put(key, value). } you could have the performance of void addParameter (HashMap h?, int size?, String key, Object value) as if you wrote overloaded methods without needing to write several different methods that just supply default values back forth. Sometimes, it's also possible to use a better algorithm if parameters have a known constant value. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Feature idea
Yeah, probably from a compiler's perspective, the value check may be more complicated (the value may only be available after the AST stage depending on when optimization is done) It can possibly bloat the resultant code (since I believe you may have to build different implementations of each function and you may get overhead, even if you inline). However, I think this might be an OK tradeoff since the assumption would be that you are optimizing for speed as opposed to size if you use something like GWT.isLiteral. On Mon, Apr 27, 2009 at 3:45 AM, Ray Cromwell cromwell...@gmail.com wrote: +1 I suggested a similar feature a few days ago privately, I called it GWT.isLiteral(), since the underlying check is if its an AST literal in the compiler, although in my example, you can't do value comparisons, just assertions on the literal. The value checks would be done via traditional operators. On Mon, Apr 27, 2009 at 12:33 AM, Vitali Lovich vlov...@gmail.com wrote: Kinda like with GCC, allow detection of constant values (i.e. __builtin_constant_p). This way, you could do something like void addParameter (HashMap h, int size, String key, Object value) { if (GWT.isConstantValue(h, null)) { if (GWT.isConstantValue(size, 0)) size = 10; h = new HashMap(size); } h.put(key, value). } you could have the performance of void addParameter (HashMap h?, int size?, String key, Object value) as if you wrote overloaded methods without needing to write several different methods that just supply default values back forth. Sometimes, it's also possible to use a better algorithm if parameters have a known constant value. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: New shopping new life!
Wow that takes me back. I've stopped using my hotmail actively for already about 2-3 years. I have my thunderbird on my desktop occassionally download filter through all the spam for archival purposes. It just annoys me how locked down it is. With gmail (not a plug, just the best web-based email I've used so far) you get free POP IMAP access there are no restrictions with forwarding (i.e. if you switch somewhere else). Hotmail was amazing back in the day - MS has just managed to strangle every single web-based strategy they had. On Mon, Apr 27, 2009 at 8:42 AM, Ed post2edb...@hotmail.com wrote: He Joel, Sorry for the trouble. Last night I came home and all of sudden my whole hotmail was changed and got all kind of failed mail deliveries :(... Yep, changed my password already. -- Ed --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
Re: JsArrayJavascriptObject methods deficiency
Just as an aside, I have a set of patches to implement all the missing native methods from JsArray (splice, etc). I'll be opening a defect soon. On Sun, Apr 26, 2009 at 2:33 AM, Adam T adam.t...@gmail.com wrote: Best thing to do is either: a) raise a defect and then this gets tracked, and if indeed the world is suffering due to this, then they can star it to get higher visibility. b) submit a patch through the contributor list (afterall, GWT is open source) - are you 100% sure this is cross-browser compatible? http://groups.google.se/group/Google-Web-Toolkit-Contributors?hl=sv You should check that there's no other similar defect first (e.g. perhaps http://code.google.com/p/google-web-toolkit/issues/detail?id=2793q=JsArray ). //Adam On 26 Apr, 04:53, Blessed Geek blessedg...@gmail.com wrote: I am wondering why GWT team has overlooked the need for - get (String key) method - toArray() method Therefore, I had to extend JsArray public class JsObjectArray extends JsArrayJavaScriptObject { protected JsObjectArray(){} final public native String get(String key) /*-{return this[key]; }-*/; final public String[] toStringArray() { String[] values = new String[this.length()]; for (int i=0; ithis.length(); i++) { values[i] = this.get(i).toString(); } return values; } } I strongly believe (to the utmost nth order) that GWT should provide these methods within JsArray rather my (and the rest of the world) having to maintain our own individual class extension to get these functionality. --~--~-~--~~~---~--~~ 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: Request after request.
On Sun, Apr 26, 2009 at 3:29 PM, davidst...@gmail.com davidst...@gmail.comwrote: Are you sure you're not doing a notify? Maybe you actually receive an event? InterruptedException (from memory, haven't looked at the javadoc) get's called when wait times out - if you call notify, it'll wake up the thread normally. That's exactly what i do there, notifying. Forgive my newbieness, i thought notify should cause InterruptedException Minus one problem. But i still can't understand what is going on with Hosted Mode. There is something else, new session does not open for new client. Maybe it is something local on my comp, maybe there is something to configure ? What do you mean by new session (I hate this term in general because so many things have sessions that the term loses all meaning). Is there some specific session id you are referring to? Threads? On Apr 24, 6:55 am, Vitali Lovich vlov...@gmail.com wrote: On Thu, Apr 23, 2009 at 2:05 PM, davidst...@gmail.com davidst...@gmail.comwrote: I tested both FF and IE6 . I'm pretty surprised too of the results, so I'm still searching the problem. Are you calling getEvents (the one that sends of the request to the server) on the client-side more than once? No, i checked it after you said that two requests is the maximum. I call the getEvents only once, after logging in. There is also something weird happens when it runs in browser . In the getEvents on server side in this part I can't imagine a case where the server side behavior will change if you use hosted mode or a browser. I mean hosted mode runs in the same VM, but it's a different thread. try { synchronized( user ) { user.wait( 20*1000 ); } } catch ( InterruptedException ignored ) { System.out.println(Server interupted, sending response); } when interrupted the message is not printed. It does not enter the catch clause at all. Are you sure you're not doing a notify? Maybe you actually receive an event? InterruptedException (from memory, haven't looked at the javadoc) get's called when wait times out - if you call notify, it'll wake up the thread normally. Or is the other way around? In any case, put the print after your catch - that's where it belongs. But definitely, instrument getEvents something like this on the server side: System.out.println(user + waiting for events); try { // code for getEvents} finally { System.out.println(user + responding to client); } That'll help you figure out what your server is doing. Also, you can usehttp:// code.google.com/p/google-web-toolkit/wiki/LightweightMetricsDe...to inject profiling of your RPC calls to figure out what your browser is actually doing (in case you miss something). I've added some print after wait in the try clause, and when the server interrupted the message in the try clause printed. Is it magic or something ? ))) On Apr 23, 12:01 pm, Vitali Lovich vlov...@gmail.com wrote: Seriously doubt it's a hosted mode mode issue. Which browser did you test web-mode with? Hosted mode actually launches a version of IE6, so using FF or IE7 may present different issues (for instance they might have a raised AJAX connection limit) The issue is purely on the client side. Are you calling getEvents (the one that sends of the request to the server) on the client-side more than once? On Thu, Apr 23, 2009 at 4:44 AM, davidst...@gmail.com davidst...@gmail.comwrote: Well, it really looks like a bug, cause when i compile it to browser it works properly ( meanwhile ). Thanks for your answers. On Apr 23, 10:05 am, Salvador Diaz diaz.salva...@gmail.com wrote: As Vitali said, there are some common pitfalls when trying to implement something along the lines of whatyou're trying to do. There have been plenty of discussions related to chat implementations and server-push. You might want to look at this docs: http://docs.codehaus.org/display/JETTY/GWT+RPC+Exampleshttp://code.go.. .. .. And also comment on this bug if you have any problems or even if you succeed: http://code.google.com/p/google-web-toolkit/issues/detail?id=267 Hope it helps, Salvador On Apr 23, 9:40 am, davidst...@gmail.com davidst...@gmail.com wrote: I open two clients, and trying to send a message from one to another. So i have two requests hanging on server's side, and the third one trying to send the message. the server side is like this : @Override public ArrayListEvent getEvents( Integer sessionId ) { UserInfo user = getUserById( sessionId );; ArrayList
Re: Where is this class com.google.gwt.core.client.RunAsyncCallback in GWT 1.6.4
It's in trunk (as the svn path tells you). It's scheduled to make an appearance with 2.0. You either need to build from trunk or wait. On Sun, Apr 26, 2009 at 1:18 PM, maximity maxim...@gmail.com wrote: I downloaded showcase example from Google SVN (http://google-web- toolkit.googlecode.com/svn/trunk/samples) but I am getting compilation errors because com.google.gwt.core.client.RunAsyncCallback is missing. I am using GWT 1.6.4. Was this class deprecated or replaced? How do I make the showcase work with GWT 1.6.4? Thanks The class is also missing from the web JavaDoc. http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/index.html?overview-summary.html --~--~-~--~~~---~--~~ 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: throwing exceptions in onModuleLoad
By the way, it's really bad style to throw an exception in onModuleLoad - it indicates you are doing something wrong. 2009/4/26 Piotr Jaroszyński p.jaroszyn...@gmail.com http://www.google.com/search?q=unchecked+exception Thanks, apparently I fail at java :) -- Best Regards, Piotr Jaroszyński --~--~-~--~~~---~--~~ 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: efficiency of my gwt application
On Sat, Apr 25, 2009 at 10:05 PM, ytbryan ytbr...@gmail.com wrote: thank you for all replies. i have a few questions: 1) JSON data graph with Javascript Overlay -- i can't find example on this... can someone tell me what is this? not sure what you mean here. What data graph? Coding basicshttp://code.google.com/webtoolkit/doc/1.6/DevGuideCodingBasics.htmlis very useful - has a good introduction to overlay objects. 2) so the rendering of the data is probably the reason why an application looks slow. never make assumptions about performance. profile your application get hard numbers. there's several reasons to do this, 2 are extremely important. 1) You are not making guesses - you know exactly where the problem is in your code. 2) You know if your optimizations actually make something faster or slower. if the data i want to transfer from server to client is huge. should i still be using RPC? or is there a better method? currently, i am using gwt-rpc to transfer 2d array of string. It depends. RPC is very good more importantly, it's extremely convenient to use. If the bottleneck is really the deserialization or the transferred data is too big, you may want to serialize to JSON instead then just eval on the client side cast it to an overlay object - that'll definitely be faster in terms of deserialization performance, and may be smaller in terms of transfer size. However, the server impact is much harder to estimate - there are too many factors. It could improve performance, make it worse, or have no impact. 3 can someone explain to me why the need of JSON and XMl serialisation? besides the need to communicate with non-java server? Not sure what you mean here. JSON XML data sources are very common on the internet. Many web-apps use services data stores on third-party servers (i.e. Google maps). Since google likes people building things on top of their services, building it into GWT is nice (although adding this functionality is not difficult since the browsers support it natively). thanks.. On Apr 16, 6:04 pm, Jason Essington jason.essing...@gmail.com wrote: Their reasoning was that object instantiation was orders of magnitude slower than simply building the HTML. in some cases even building HTML on the client was too slow, so they would shuttle it off to the server. The application would decide at runtime which way was faster, and use the fastest method. For a quick rendering test, you can try to create a 100x100 table (grid) using GWT widgets, and then do the same thing using setInnerHTML() (with a string that ultimately has the same DOM) ... you'll find that while the setInnerHTML() is nearly instantaneous, the creation of the widgets takes some time. Creation of individual DOM elements in javascript seems to be pretty slow (it is a bit faster in the new generation browsers ff3, Safari4 and chrome) but setInnerHTML() doesn't create those elements in javascript, it is done natively in the browser and thus is much faster. Another technique that I use when populating multiple cells that have the same HTML structure is to embed a hidden template in the host page. This template has all of the HTML structure, but no content. I have GWT find and store the elements that will be bound with data (traverse the DOM of the template only once) from my model objects, then when I need to fill the cells, I setInnerText, or setInnerHTML() on each of the found elements from the template, and once the databinding is complete, perform a getInnerHTML() on the template, and use that string to setInnerHTML() on the cell ... this works great as there is really no DOM object creation happening in Javascript, and is considerably faster than building up the widgets individually. -jason On Apr 16, 2009, at 9:44 AM, Vitali Lovich wrote: Can you point out the relevant segments within the presentation? I skimmed through some parts, it seemed like they went for just building the raw HTML on the client side (hence the reason they transfer HTML from the server). Also, they're presentation is for 1.4, so they're reasons might not be relevant any more (especially since 1.5 included a lot of improvements 1.6 introduced improvements with the event subsystem). Also, they don't seem to be using deferred binding for some reason to get around On Thu, Apr 16, 2009 at 11:19 AM, Jason Essington jason.essing...@gmail.com wrote: You might want to tell the Lombardi Blueprint guys that ... as it turns out, they discovered in the development of their application that you are mistaken on all points. Feel free to watch their presentation from Google I/O last year if you'd like to check my references: http://sites.google.com/site/io/using-gwt-to-build-a-high-performance. .. -jason On Apr 16, 2009, at 9:10 AM, Vitali Lovich wrote: I dunno
Re: new to GWT, trying to determine the cause of compilation errors for existing software project
I thought you were trying to use the built-in OutputStream. Are you sure the package name on your class is right? Shouldn't it be gwt.extended.common.java.io? On Sun, Apr 26, 2009 at 2:34 AM, Jake otakuj...@gmail.com wrote: Thomas and Vitali, thank you for the expert advice. I believe I'm beginning to put this problem into perspective. Here is the OutputStream implementation bundled with this project: http://dev.eclipse.org/viewcvs/index.cgi/e4/org.eclipse.e4.swt/bundles/org.eclipse.swt.e4.jcl/src/gwt/extended/common/java/io/OutputStream.java?view=markup Here's the top-level module file I'm attempting to compile: http://dev.eclipse.org/viewcvs/index.cgi/e4/org.eclipse.e4.swt/examples/org.eclipse.swt.e4.examples/dojo/controlexample/controlexample.gwt.xml?view=markup Finally, here's the module file which should pull in OutputStream.java: http://dev.eclipse.org/viewcvs/index.cgi/e4/org.eclipse.e4.swt/examples/org.eclipse.swt.e4.examples/dojo/controlexample/controlexample.gwt.xml?view=markup My theory right now is that for some reason, our project's custom OutputStream.java is not being found or used, and is therefore being replace by GWT's built-in OutputStream class. But I'm not sure how that could occur, as I know that GWT errors out if I specify a module that it cannot find. So it seems that it must have found the module, but is for some reason not using it in favor of its built-in OutputStream class. Very strange. If you have any idea as to why this might be occurring, or how to correct it, I would greatly appreciate it if you would let me know. Thanks, Jake On Apr 25, 6:07 pm, Thomas Broyer t.bro...@gmail.com wrote: On 25 avr, 16:54, otakuj462 otakuj...@gmail.com wrote: Hi, I'm quite new to GWT, and I'm trying to diagnose the source of some compilation errors for an existing open source project that leverages GWT (incidentally, for my Google Summer of Code project). Without going into the details of the purpose of the application, I was hoping someone could offer some general guidance as to why these particular errors might be occuring. The errors occur when attempting to compile certain method calls on instances of class OutputStream. So, for example: [java][ERROR] Errors in 'file:/C:/workspace-gsoc/ org.eclipse.swt.e4.jcl/src/gwt/extended/javascript/java/io/ OutputStreamWriter.java' [java] [ERROR] Line 31: The method close() is undefined for the type OutputStream [java] [ERROR] Line 42: The method flush() is undefined for the type OutputStream [java] [ERROR] Line 56: The method write(byte[], int, int) is undefined for the type OutputStream This is on GWT 1.5. I also tried it on GWT 1.6, and I believe it threw the same error. I know that on GWT 1.6, OutputStream is emulated [http://code.google.com/webtoolkit/doc/1.6/RefJreEmulation.html], but I'm not sure about 1.5. As the doc says, no method is emulated on OutputStream, only the (default) constructor: http://code.google.com/p/google-web-toolkit/source/browse/releases/1 Actually OutputStream is only there to support System.out.print()/ println(), so that you could use it in your code and get it compiled to a no-op in JavaScript, without compile error. I'd appreciate any guidance anyone can offer. Provide your own OutputStream emulation (and make sure it is picked in place of the one packaged within GWT) For instance, this is the emulated OutputStream for an Adobe AIR environment: http://code.google.com/p/gwt-in-the-air/source/browse/trunk/super/net... --~--~-~--~~~---~--~~ 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: unused code in compiled javascript
The GWT compiler is supposed to remove all unused code. If you believe that there's code in there that is unused, or can be removed, I would recommend filing a bug. Hopefully a GWT developer would be able to provide more information about this particular question. On Sun, Apr 26, 2009 at 5:03 PM, zbo zachary.bo...@gmail.com wrote: Hello, I am working on reducing the compiled js size of a relatively complex GWT application. I've been looking at the detailed output of the compile process, and find quite a few blocks of code that seem to be included no matter what. To test things and get a better understanding of the GWT compile process, I build a trivial GWT app: onModuleLoad() { RootPanel.get().add(new Label(placeholder); } Detailed output of this app was approximately 105k in size, and filled with code I would expect (management of GWTEvents, onLoad methods, String handling, etc) but also a lot of code that I wouldn't expect (Hashmap, HashSet, AbstractSet, Set, Collections, etc.) My question - is this entirely necessary, and if not, how do I avoid having all of this code included a final compile of a real app? -Z --~--~-~--~~~---~--~~ 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: Given: One WAR archive; three independent Host Pages; common client and server code. Question: How to best organize such project(s) and have each HTML page load only its used code?
I haven't actually done this, but check any of the numerous GWT libraries. They all provide library code without an entry point. http://code.google.com/p/gwtquery/, http://code.google.com/p/gwt-mosaic/ On Sun, Apr 26, 2009 at 8:26 AM, JDK software.solutions.engin...@gmail.comwrote: I've spent quite a while reading related posts but my question remain unanswered. Kindly, advise me on this from the perceptive of your experience with it. My web app is comprised of three HTML pages each of which is independent of others and has its own Entry Point. One of these pages is the main page (index.html) and the assumption is that it may often be the only page accessed/viewed in the web app. Among other UI controls, the main page has two Anchor Widgets to link to two other pages. Despite the fact that all three pages are independent of each other in terms of their use-case, they nevertheless share a lot of custom UI and server-side (GWT-RPC) code. In my attempts to organize the project in a most efficient way I have created three modules each of which has: 1) its own Module gwt.xml file 2) its own HTML Host Page 3) its own implementation of EntryPoint interface In order to use the code from Module A in Module B the latter inherits the former. This, however, at runtime of Module B, causes the execution of onModuleLoad() of Module A. This is undesirable effect and I am looking for ways to avoid it. I have tried creating a fourth module which accommodates a common code but that has proved (a) inconvenient, and (b) still requires its own EnrtyPoint implementation (which I purposely leave empty because it gets executed when this module is inherited and its sub-module runs). I have also tried making the fourth module available only as a lib of classes without having its Entry Point but the complier insists that it does. The desired outcome of my project setup is such that all three modules (and more in future) reside in the same Eclipse project; the web app is packaged and deployed in a single WAR archive and is comprised of independent Host Pages one for its own module. Some or all modules reuse client-side and server-side code of one or more other modules with the assumption that (a) the inheriting module is the only one that gets executed (and not the inherited one), and (b) only needed code is loaded with each respective Host Page and not the common code in the web app. Please advise me on how to best approach this situation. I will also consider factoring out common code into a separate GWT Module in its own Eclipse project or any other suitable options. Thank you in advance! --~--~-~--~~~---~--~~ 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] Re: GEP, war/WEB-INF/lib, and source control
That's pretty much the approach I use. I prefer to keep the war/ directory as minimal as possible in terms of what is in source control. I keep only the web.xml app HTML page. By default the war/ directory gets added to ignore because that is where generated resources are placed. Instead I prefer to use ant to copy the necessary resources across during compilation. The downside is that you need to maintain Eclipse paths separately. I find it's not a major issue as the project gets older, because paths don't tend to change. The problem does appear though if they do change, because after a while your developers will probably be using Eclipse exclusively, so they'll fix Eclipse and forget about ant (forgetting about Eclipse isn't that big a deal because your developers will notice it right away). On Sun, Apr 26, 2009 at 12:35 PM, Isaac Truett itru...@gmail.com wrote: Thanks. That is an interesting thread, although it seems to be addressing a separate need: multiple classpath definitions, which I think would be a big win for the GEP. I've been using multiple classpath definitions in my Ant build scripts for years. Usually there's a runtime classpath with JDBC drivers, maybe something from Apache Commons, and anything else I need to deploy. There's also a dev classpath which includes everything on the runtime classpath, plus libs that are only used during development or are known to be provided by the app server (the core J2EE lib, for example). This dev classpath has things that I need in order to compile, test, etc., but that will not ultimately be deployed with the app. With GWT applications, the dev classpath will also include any client-only libraries (e.g., gwt-incubator.jar). Having all of this in one classpath definition causes GEP to generate warnings. There's an ignore the fact that this won't be available on the server feature in GEP to remove these warnings, but I think turning that into a more explicit runtime vs. dev configuration would be beneficial. Solving the source control issue is then pretty simple: the plugin would copy all static content, GWT compiler output, and anything on the runtime classpath into a configurable exploded webapp dir where either the bundled Jetty or an external (-noserver) app server can serve the app. I can check into source control any libraries that I choose and reference the others as Eclipse libraries, classpath variables, etc. On Sat, Apr 25, 2009 at 10:45 PM, Allen Firstenberg g...@addventure.com wrote: There has also been some similar discussion in this thread: http://groups.google.com/group/google-appengine-java/browse_thread/thread/67cb7cdaefc8429f?tvc=2 --~--~-~--~~~---~--~~ 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: JsArrayJavascriptObject methods deficiency
Unfortunately, I have already implemented my own version. This means that regardless of which is better (or even if they are identical) I must criticize reject yours out of hand. On a serious note, why do some of your methods have a GWT.isScript check? On Sun, Apr 26, 2009 at 5:43 PM, Thomas Broyer t.bro...@gmail.com wrote: On 26 avr, 20:23, Vitali Lovich vlov...@gmail.com wrote: Just as an aside, I have a set of patches to implement all the missing native methods from JsArray (splice, etc). I'll be opening a defect soon. I already did so 8 months ago: http://code.google.com/p/google-web-toolkit/issues/detail?id=2793 ...but it has no tests... --~--~-~--~~~---~--~~ 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: Same app in several Hosted Pages
That layout is fine, except for gwtapps - usually the apps go directly under webroot (you may have to modify the default ant scripts whatnot). However, the better approach might be to split each application into 2 parts. 1 part for the front-end specific for each page (i.e. the code containing onModuleLoad) a backend-frontend that is specific for the application. That way you can load whatever frontend you want in the onModuleLoad. If you want, you can also use the HTTP parameters (as in the previous post) as additional selection options. On Sun, Apr 26, 2009 at 7:12 AM, JITEchno jitec...@gmail.com wrote: Hello, I have similar problems, I need few pages with different Javascriots. I stsrted from 2 classes with MainEntryPoint, but was not able manage it.. Only solution, what I found, put all code for generation JS under one MainEntryPoint for page.html, and call corresponding section of code using parameter. So u have not: page1 page2.. but u have page.html? param=1 or param =2 Not so elegant solution.. On Apr 25, 10:22 am, GWTSavvy mdmv1...@gmail.com wrote: Hi All, I have the following structure for my application. webroot |--pages | |page1.html | |page2.html | |page3.html | |--gwtapps | |app1(folder with app1 javascript+resources files) | |app2(folder with app2 javascript+resources files) | |--WEB-INF ||classes ||lib ||web.xml The reason is that I would like to put any GWT app I like on any page in the pages directory. I think RPC calls can be easily routed using the web.xml to the GWT Application Servlets. But getting the Javascript loaded from the correct director is the issue. Can anyone please help me on this?? A BIG Thanks in Advance... --~--~-~--~~~---~--~~ 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: Identifying what css are loaded
Document.get().createLinkElement On Sun, Apr 26, 2009 at 11:15 PM, jagadesh jagadesh.manch...@gmail.comwrote: How can i identify whether css has loaded or not .meanwhile i got a code snippet as public native boolean isLinkLoaded(LinkElement le)/*-{ try { return le.readyState==Complete; }catch(e){ return e; } }-*/; but how can i create a link element in GWT. --~--~-~--~~~---~--~~ 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: Identifying what css are loaded
Oh, and you can always retrieve an existing link element on the page (assuming it has an id). On Sun, Apr 26, 2009 at 11:34 PM, Vitali Lovich vlov...@gmail.com wrote: Document.get().createLinkElement On Sun, Apr 26, 2009 at 11:15 PM, jagadesh jagadesh.manch...@gmail.comwrote: How can i identify whether css has loaded or not .meanwhile i got a code snippet as public native boolean isLinkLoaded(LinkElement le)/*-{ try { return le.readyState==Complete; }catch(e){ return e; } }-*/; but how can i create a link element in GWT. --~--~-~--~~~---~--~~ 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 best Practices - JS Library Wrappers Overlay Types
Couldn't arbitrary JS support be added using deferred binding? Sure, you wouldn't be able to do code completion, but you could call arbitrary JS functions variables with 0-overhead. Might be a cool project to do (if Ray hasn't already done it :D). On Sun, Apr 26, 2009 at 11:43 PM, Bobby bobbysoa...@gmail.com wrote: I finally got the GData library to compile inside a GWT 1.6 test app. Now it's down to testing. I'm considering auto generating a test app as well, otherwise i won't be able to find out what's broken, otherwise i have to test each class manually. It looks good at this point but i'm antecipating plenty of headaches in testing. Bobby On Apr 20, 6:51 pm, Bobby bobbysoa...@gmail.com wrote: The GData JS API is doing some fancy stuff to be able to POST data across domains, etc, it's also fairly large (in number of classes) and it's missing some large GData components (for Google Docs and Spreadsheets). All of this i'm guessing is why Google doesn't have a GWT library out for GData yet. I wouldn't want to code this manually but i if i can automate it then it's ok. I'd rather wait to see some code ;-) (and I have so many projects yet that I don't have time to update...) Oh right, no chance, it's now or never (or whenever you feel like up to it, just let me know). I'm counting on being able to auto-generate a decent wrapper without much difficulty, if this becomes complex or beyond my means i'll just let Google worry about it. This is why i want to test a rough version of the wrapper ASAP. Anyway thanks for all the pointers, i'll post more questions here as they come up. Bobby On Apr 20, 6:04 pm, Thomas Broyer t.bro...@gmail.com wrote: On Mon, Apr 20, 2009 at 6:38 PM, Bobby wrote: I realize that your getConstant approach has an initialization overhead but i'm going to overlook that so that i can get the generated library to a point where i can test it and then come back and revisit this. This will be more complex because the GData JS implementation allows namespaces to be loaded dynamically as needed. Given that the protocol is clearly defined and documented, I wonder if a pure GWT implementation wouldn't be better... Well, eventually, that could be your v2.0 ;-) On the return type of the JS methods that receive callbacks, most likely these methods return void, i think that's just the way the JSDocs display - otherwise they would have to display that as void updateEntry(google.gdata.Entry function(Object) continuation, google.gdata.Entry function(Error) opt_errorHandler). Er, you probably mean void updateEntry(void function(google.gdata.Entry) continuation, void function(Error) opt_errorHandler) This type of ambiguity is why an 100% auto-generate is not going to happen - in addition to this there are a couple of classes missing from the JS Docs (i'll just fill those in from the GData Java docs). Well, I don't know what you're generating from, but it could be as easy as if the method takes 2 arguments of type function, the second one taking an Error argument, then convert them to an AsyncCallbackT where T is the method's documented return type, and make the method actually have a void return type. I like the idea of using an intermediate class to handle the callbacks, i think you mentioned this in your original reply and i missed it. Hmm, not quite sure what you're talking about... If you're interested, and since you already put some time here i can add you as a member of this project: http://code.google.com/p/gdata-gwt-client/ This way you get some credit. I'd rather wait to see some code ;-) (and I have so many projects yet that I don't have time to update...) This is a key library for GWT in my opinion and it's missing - Google says they don't have plans to do this right now so it's a good opportunity. Probably because they'd rather do it in GWT than as a GWT wrapper around the JS API, which is a bit more work probably... (and they'd have to have time to maintain it, etc.) Anyway, good luck ;-) -- Thomas Broyer- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: MenuItem icons
yes. you probably want to know how, don't you :). new MenuItem(bundle.image().getHTML(), true, /* whatever 3rd parameter goes here */); bundle is your ImageBundle, image is the method that returns an AbstractImagePrototype. On Sun, Apr 26, 2009 at 11:32 PM, Hannson hann...@gmail.com wrote: Hi all, Is there some standard way to add an icon to a MenuItem using an ImageBundle? --~--~-~--~~~---~--~~ 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: Request after request.
Uggh - I don't bother with that. There's too many problems (at least anecdotally from 3rd parties - I've never used it myself). I think it's because there's no good overview describing how it works what the various limitations are. Thus when you integrate with GWT, you can encounter situations that might never happen in a deployed environment. I personally prefer to generate a session id manually (if one isn't given) then provide it to the client for future reference. Probably you're best bet would be to look on Java forums app server or java webapp forums to find more info about how the thread-local request session id is generated. It might help you track down what is wrong, or figure out if this is a limitation in general. When you say different clients, do you mean two firefox windows or two IE windows? Try 1 browser A window, 1 browser B window. I don't really see a problem with two different tabs of the same browser getting the session id. Let's the user continue their session from another tab/restart on tab close which is a nice usability feature from the user's perspective IMHO. I don't have a lot of experience with using servlet sessions (I always prefer to create my own since I'm fairly confident I can do it following good security practices all of these have really been throw-away school projects), so I probably can't provide any more detailed advice - does anyone else have better advice? On Mon, Apr 27, 2009 at 12:53 AM, davidst...@gmail.com davidst...@gmail.com wrote: I mean this : getThreadLocalRequest().getSession().getId() gives me the same id for two different clients that are opened. Someone told me that maybe two browsers share a cookie cache/address space and because of that they see the same cookie. I googled this theme about two weeks but i did not find out how to separate them . So maybe this affects in some way the story with requests, maybe there is only one thread openes for two clients. On Apr 26, 11:07 pm, Vitali Lovich vlov...@gmail.com wrote: On Sun, Apr 26, 2009 at 3:29 PM, davidst...@gmail.com davidst...@gmail.comwrote: Are you sure you're not doing a notify? Maybe you actually receive an event? InterruptedException (from memory, haven't looked at the javadoc) get's called when wait times out - if you call notify, it'll wake up the thread normally. That's exactly what i do there, notifying. Forgive my newbieness, i thought notify should cause InterruptedException Minus one problem. But i still can't understand what is going on with Hosted Mode. There is something else, new session does not open for new client. Maybe it is something local on my comp, maybe there is something to configure ? What do you mean by new session (I hate this term in general because so many things have sessions that the term loses all meaning). Is there some specific session id you are referring to? Threads? On Apr 24, 6:55 am, Vitali Lovich vlov...@gmail.com wrote: On Thu, Apr 23, 2009 at 2:05 PM, davidst...@gmail.com davidst...@gmail.comwrote: I tested both FF and IE6 . I'm pretty surprised too of the results, so I'm still searching the problem. Are you calling getEvents (the one that sends of the request to the server) on the client-side more than once? No, i checked it after you said that two requests is the maximum. I call the getEvents only once, after logging in. There is also something weird happens when it runs in browser . In the getEvents on server side in this part I can't imagine a case where the server side behavior will change if you use hosted mode or a browser. I mean hosted mode runs in the same VM, but it's a different thread. try { synchronized( user ) { user.wait( 20*1000 ); } } catch ( InterruptedException ignored ) { System.out.println(Server interupted, sending response); } when interrupted the message is not printed. It does not enter the catch clause at all. Are you sure you're not doing a notify? Maybe you actually receive an event? InterruptedException (from memory, haven't looked at the javadoc) get's called when wait times out - if you call notify, it'll wake up the thread normally. Or is the other way around? In any case, put the print after your catch - that's where it belongs. But definitely, instrument getEvents something like this on the server side: System.out.println(user + waiting for events); try { // code for getEvents} finally { System.out.println(user + responding to client); } That'll help you figure out what your server is doing. Also, you can usehttp:// code.google.com/p/google-web-toolkit/wiki/LightweightMetricsDe...to inject profiling of your RPC
Re: Identifying what css are loaded
Also, you have bad form in your isLinkLoaded. In HostedMode, that code won't run - it'll throw a type exception. In compiled web-mode, it'll run but you'll get unexpected behavior since you'll have an exception objected treated as a boolean. For instance, on an exception, any code that checks for isLinkLoaded will return true, which might not be what you want. On Mon, Apr 27, 2009 at 12:18 AM, jagadesh jagadesh.manch...@gmail.comwrote: Thanks Vitali Lovich, Let me work this stuff. --~--~-~--~~~---~--~~ 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: FormPanel Results
You encode the XML as regular text within an HTML page. Then you decode it to get the original document back. optionally, you can use base64, which while probably expanding the code, is a much simpler approach much more difficult to get wrong. There's plenty of free implementations of base64 in JS non-ie browsers actually supply a native base64 encode/decode function (window.btoa, window.atob). I'd only recommend using base64 if your XML is small or if you can return a gzipped document (not sure if FormPanel allows it, but I would be surprised if it doesn't). Another approach (faster less overhead) would be to just put your JSON response in the HTML page. then you can just do an eval on the result it'll be much faster for everyone involved (server client). On Sat, Apr 25, 2009 at 9:04 AM, Charlie codeboo...@gmail.com wrote: I found this thread searching: http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/674c7863d88700c9/510196f74a09b4b7?lnk=gstq=getResults#510196f74a09b4b7 can anyone explain to me the trick that is being offered in the before last message? it will be really helpful thanks you On Apr 25, 3:50 pm, Charlie codeboo...@gmail.com wrote: Hey Everyone I'm stuck with the following issue: I'm sending a form to my php file and I want to get response as an xml but the only way possible is in HTML, how can I turn this HTML to XML. I'm talking about: onSubmitComplete(SubmitCompleteEvent event) event.getResults() The results from the PHP file returns as an HTML instead of an XML like I wanted. --~--~-~--~~~---~--~~ 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: new to GWT, trying to determine the cause of compilation errors for existing software project
OutputStream is in GWT 1.5. OutputStream is an abstract class - are you overriding the methods it throws errors on? eclipse is good about telling you auto-fixing stuff like that. can you post your implementation of OutputStreamWriter if this isn't the problem? On Sat, Apr 25, 2009 at 10:54 AM, otakuj462 otakuj...@gmail.com wrote: Hi, I'm quite new to GWT, and I'm trying to diagnose the source of some compilation errors for an existing open source project that leverages GWT (incidentally, for my Google Summer of Code project). Without going into the details of the purpose of the application, I was hoping someone could offer some general guidance as to why these particular errors might be occuring. The errors occur when attempting to compile certain method calls on instances of class OutputStream. So, for example: [java][ERROR] Errors in 'file:/C:/workspace-gsoc/ org.eclipse.swt.e4.jcl/src/gwt/extended/javascript/java/io/ OutputStreamWriter.java' [java] [ERROR] Line 31: The method close() is undefined for the type OutputStream [java] [ERROR] Line 42: The method flush() is undefined for the type OutputStream [java] [ERROR] Line 56: The method write(byte[], int, int) is undefined for the type OutputStream This is on GWT 1.5. I also tried it on GWT 1.6, and I believe it threw the same error. I know that on GWT 1.6, OutputStream is emulated [http://code.google.com/webtoolkit/doc/1.6/RefJreEmulation.html], but I'm not sure about 1.5. I'd appreciate any guidance anyone can offer. Thanks, Jake --~--~-~--~~~---~--~~ 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: Synchronous YES/NO/Cancel message box
Why does it have to be synchronous? Not sure what kind of message box you are referring to, but it's fairly trivial to convert a synchronous algorithm to an asynchronous one. // synchronous code // message box // synchronous code instead make it // synchronous code // message box // in asynchronous result from message box, continue with synchronous code. On Sat, Apr 25, 2009 at 4:08 PM, Paul Grenyer paul.gren...@gmail.comwrote: Hi All I'm using GWT 1.6 and gwt-ext and need a Yes/No/Cancel message box that is NOT asynchronous. Google isn't helping. Can anyone else point me in the right direction, please? Thanks! -- Thanks Paul Paul Grenyer e: paul.gren...@gmail.com w: http://www.marauder-consulting.co.uk b: paulgrenyer.blogspot.com --~--~-~--~~~---~--~~ 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: Error finding source code for JSONValue in GWT 1.6.4
Do you have gwt-user on your classpath when you compile? The GWT compiler needs the source files on the class path, because it actually needs to compile the code into javascript. .class files are insufficient (don't preserve enough of the structure of the program I imagine). Also, maybe you have a corrupt gwt-user? Try redownloading it again. On Sat, Apr 25, 2009 at 3:58 PM, ceeed cee...@gmail.com wrote: Hi, With GWT 1.6.4, I am getting the following error. [ERROR] Line 80: No source code is available for type com.google.gwt.json.client.JSONValue; did you forget to inherit a required module? [ERROR] Line 80: No source code is available for type com.google.gwt.json.client.JSONParser; did you forget to inherit a required module? Any ideas? thanks, --~--~-~--~~~---~--~~ 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: Error finding source code for JSONValue in GWT 1.6.4
Lol - didn't even think of that. That's probably what it is. On Sat, Apr 25, 2009 at 5:59 PM, Thomas Broyer t.bro...@gmail.com wrote: On 25 avr, 21:58, ceeed cee...@gmail.com wrote: Hi, With GWT 1.6.4, I am getting the following error. [ERROR] Line 80: No source code is available for type com.google.gwt.json.client.JSONValue; did you forget to inherit a required module? [ERROR] Line 80: No source code is available for type com.google.gwt.json.client.JSONParser; did you forget to inherit a required module? Any ideas? Did you inherits name=com.google.gwt.json.JSON / ? --~--~-~--~~~---~--~~ 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: java.lang.ref in GWT
Yeah, it's quite doubtful. The technique I would see JS engine writers adopting would be an event generated indicating low memory (so the app can remove cached memory). However, this would be a far off time in the distance, if ever would take a while to trickle into browsers as a standard feature. 2009/4/25 zold...@gmail.com zold...@gmail.com Hi Mark Renouf Thank you for reply. Let me try to give an example (maybe not very appropriate). I create tree on page. I get data for that tree from server. I can get data for all tree nodes to construct tree, or make new requests to server when user opens new nodes. Suppose whole tree is too big to load it all. User opens and closes nodes during his work. I can free memory resources connected with closed nodes (eliminate references) immidiately, but what if user opens it again? Then application needs to make new request to server. I want to avoid it. I want to let js engine garbage collect data only when it's not enough memory. If it were desktop java application I would use java.lang.ref.SoftReference. It is similar to regular reference to java object, it has get() method to get object that it holds, but that object can also be garbage collected when application needs memory. So I just call get() and if it returns null I recreated object (request it from server, read it from file, etc.). So, I was asking about something similar in GWT. Thinking about it again, I can see that that feature should be supported by browser's js gc engine, which is doubtful. Anyway, thank you for your help! On 24 апр, 19:00, Mark Renouf mark.ren...@gmail.com wrote: Garbage collection in JavaScript is browser-dependent, but similar rules apply as with Java. When you are no longer using the data, make sure you eliminate all references to it. For example, if you've stored it in an Array or Collection of some sort, be sure to null out or remove those entries. The browser's JavaScript engine will do it's best to garbage collect that data (some better than others obviously). GWT goes to great lengths to do this for you as automatically as possible. For example, if you perform an AJAX request for a chunk of HTML and insert it into an HTML widget, insert it into the page, then later remove it, GWT ensures that the element is cleanly detached from the DOM and the Widget object is removed from it's parent. Assuming you haven't stored it elsewhere (usually not), it will be eligable for garbage collection. Others can probably tell you which browsers to watch out for (IE6?), and some pitfalls that might cause problems (circular references?) On Apr 23, 6:41 am, zold...@gmail.com zold...@gmail.com wrote: I have GWT application. Use loads page, then visits links (I use GWT's Hyperlink, so page is not reloaded). Amount of data that page contain is increased (I use AJAX requests to get data from server). I have some data that shouldn't necessarily exist always, I can load it from server again. Is there any way I can tell js engine that it can be garbage collected? Something similar to java.lang.ref.SoftReference? --~--~-~--~~~---~--~~ 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: how ho handle handlers
Well, for one, you could just style it like: http://www.webappers.com/2007/06/18/simple-round-css-buttons-wii-buttons/ A more generic approach would be to maintain state in your composite. You're probably going to need click handlers for the style changes (assuming you go with a more complicated example). So something like: class MyComposite extends Composite implements HasClickHandler { class MyCompositeHandler implements ClickHandler { void addDelegatedClickHandler(ClickHandler h) { // add h to some set or list } void removeDelegatedClickHandler(ClickHandler h) { } public void onClick(ClickEvent evt) { // handle MyComposite behaviour for (ClickHandler delegated : toDelegate) { delegated.onClick(evt); } } } MyCompositeHandler handler; public MyComposite() { // initialize foo to your composite initWidget(foo); handler = new MyCompositeHandler(); button.addClickHandler(handler); } public HandlerRegistration addClickHandler(ClickHandler h) { handler.addDelegatedClickHandler(h); // return registration with widget that you are adding too. maybe wrap the result in a handler registration that also removes h from the handler when it is unregistered. } Hope this gives you some ideas (I'm not saying this is the correct or best way). Just one possible solution. On Fri, Apr 24, 2009 at 2:39 AM, romant roman.te...@gmail.com wrote: Yes, setEnabled() is the thing which can do the job for a standard gwt button. But consider the situation when you want to implement your own button (with rounded corners let's say) named RButton. You implement it as a new widget which extends Composite class and implements ClickHandler interface to get mouse clicks, but here the method setEnabled() is not available. So how to implement the setEnabled() method in this case? Do you suggest to store the ClickHandler in the RButton class itself and remove it in its setEnabled() method, or is there any better way? On 24 Dub, 06:59, Vitali Lovich vlov...@gmail.com wrote: In general I think you should keep it with the class that does needs to remove the handler. I hope you know about setEnabled/setDisabled - that's the proper way to disable a buttons functionality, not to remove the handler. In general, I have only encountered 1 situation where I would be interested in removing a handler - more often than not, you will be adding/removing the widget itself which should take care off removing the handlers to free up memory. On Thu, Apr 23, 2009 at 10:50 AM, romant roman.te...@gmail.com wrote: Hi guys, with GWT 1.6 there is the new handler-based approach for managing events. When I register, let's say, a button handler HandlerRegistration buttonRegistration = button.addClickHandler(new ClickHandler() {...do something...}); I get an instance of HandlerRegistration. Then, if I want to remove the button's handler, let's say for a while just to make the button functionality temporarily unavailable, I just call buttonRegistration.removeHandler(); But now the point is where to store the buttonHandler instance. With listeners it was easy, you just called button.removeClickListener() because the button kept the listener. If I have a large project with many buttons what is the best approach for storing and handling the HandlerRegistration instances of my buttons and other widgets? Is there any recommended design pattern? This can make a real mess in my application if I do not find some general solution of this. Thanks. Roman- Skrýt citovaný text - - Zobrazit citovaný text - --~--~-~--~~~---~--~~ 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: Insert Element into DOM and receive click events?
As a workaround, would removing the TreeItem from the parent tree itself work? It's not a general solution since you'd have to append it to the end of the tree (Tree doesn't appear to support insertion of children into arbitrary positions) to get it back, but it's what the example you gave in the issue does, so maybe it's OK for you? On Fri, Apr 24, 2009 at 2:48 AM, Ben FS ben.su...@gmail.com wrote: In my existing code, most of my TreeItem content is HTML, so it should be possible for me to clone/copy just the content as a String, squirrel it away and, after editing, return the node to its normal state by inserting a newly instantiated HTML object. I'll try this and see if I can get it to work - but it precludes me from using anything other than text or HTML in each node. I am now restricting myself to only store textual / markup in each tree node, which makes this workaround possible and gets my code back to a working state with GWT 1.6. It's not ideal, and there are some styling issues, but I'll make do with this for now. You could also try appending the button the way you've been doing before, but it'll take some tinkering around to get it hooked up properly and have the click event reach the handler. I'm still interested in how to do this, when you have time to give me some pointers. Do you know whether the FastTree, as referenced in the issue comments, would work better for what I'm trying to do? Thank you, Ben. I've done a lot of tinkering already, without success. My tree has a SelectionHandler, and that seems to keep the ClickHandler from executing when the Button's Element is appended to the DOM directly. I read the memory leak / cycle / event listener article, and I tried adding a call to sinkEvent(Event.ONCLICK), but it didn't work. I'm basically poking around in the dark ... if you can think of a workaround, I'd like to try it. I think the relevant conditions are: a Tree with SelectionHandler, OpenHandler, CloseHandler and onSelection () should dynamically append a Button with a ClickHandler next to the TreeItem content (similarly, onSelection() should first remove this Button from any previously selected nodes). If keeping clones around proves to be a problem (for example, having to do this for more than a couple of widgets), let me know and we can dig in deeper on the manual DOM.appendChild() workaround until Issue #2297 gets a fix. Hope that helps, -Sumit Chandel Thanks, you've definitely been a great help. On Thu, Apr 23, 2009 at 1:12 PM, Ben FS ben.su...@gmail.com wrote: Hi Sumit, Is there any reason why you couldn't just call treeItem.setWidget(b) ? Yes. See issue #2297 that I submitted one year ago. TreeItem.setWidget deletes state/content of the widget that is replaced http://code.google.com/p/google-web-toolkit/issues/detail?id=2297 In short, when you call TreeItem.setWidget, it deletes the content/ state in the DOM of the existing widget. For widgets that only store their state in the DOM (such as the Label), this is bad news. By default, when you supply text data to the Tree, it renders this text in each TreeItem as a Label. I want to dynamically modify an individual node (make it editable), and after editing or when a different node is selected, return the node to the original state. Let's say I do this: Widget normal = treeItem.getWidget(); // save this for later treeItem.setWidget(someEditor); // do some editing, then later in another event handler treeItem.setWidget(normal); The debugger will show that, as soon as setWidget executes, the text of the original Widget, in variable normal, has been erased. Refer to the issue I linked above to see the TreeItem source code that causes this effect. Again, it only matters for Widgets that store their state in the DOM (I don't know which these are, but I know it includes Label). That should change the tree item to the button widget and also properly register the click handlers on the button so that the handler is fired all the way out. Yes, and this does work. But I want to be able to make the change only temporary, and return the node to its original state after some time. I want it to be reversible. I tried various approaches in the past, and finally got one to work (i.e. appending a Button next to the existing Widget, but since TreeItem does not have an append method, I directly manipulate the DOM to achieve this effect in a reversable manner). This approach no longer works in GWT 1.6 - the Button event handlers no longer run. Can you suggest a better approach, please? I feel there is probably a way to achieve this (reversably show an editor control, return to normal node state afterwards) that is better than what I've tried, but I have not been
Re: Insert Element into DOM and receive click events?
Or just put a simple panel. Then set the widget of the simple panel to whatever you want. That's actually a great approach alex. Does that work Ben? On Fri, Apr 24, 2009 at 3:40 AM, alex.d alex.dukhov...@googlemail.comwrote: What about making your treeitem-widget an absolutPanel for example, put both - your lable and button in it along with a small switch- function to make only one of the visible at a time. This may cause some perfomance problems but when it's not that much of three items we are speaking about, you man not even notice it. On 24 Apr., 08:48, Ben FS ben.su...@gmail.com wrote: In my existing code, most of my TreeItem content is HTML, so it should be possible for me to clone/copy just the content as a String, squirrel it away and, after editing, return the node to its normal state by inserting a newly instantiated HTML object. I'll try this and see if I can get it to work - but it precludes me from using anything other than text or HTML in each node. I am now restricting myself to only store textual / markup in each tree node, which makes this workaround possible and gets my code back to a working state with GWT 1.6. It's not ideal, and there are some styling issues, but I'll make do with this for now. You could also try appending the button the way you've been doing before, but it'll take some tinkering around to get it hooked up properly and have the click event reach the handler. I'm still interested in how to do this, when you have time to give me some pointers. Do you know whether the FastTree, as referenced in the issue comments, would work better for what I'm trying to do? Thank you, Ben. I've done a lot of tinkering already, without success. My tree has a SelectionHandler, and that seems to keep the ClickHandler from executing when the Button's Element is appended to the DOM directly. I read the memory leak / cycle / event listener article, and I tried adding a call to sinkEvent(Event.ONCLICK), but it didn't work. I'm basically poking around in the dark ... if you can think of a workaround, I'd like to try it. I think the relevant conditions are: a Tree with SelectionHandler, OpenHandler, CloseHandler and onSelection () should dynamically append a Button with a ClickHandler next to the TreeItem content (similarly, onSelection() should first remove this Button from any previously selected nodes). If keeping clones around proves to be a problem (for example, having to do this for more than a couple of widgets), let me know and we can dig in deeper on the manual DOM.appendChild() workaround until Issue #2297 gets a fix. Hope that helps, -Sumit Chandel Thanks, you've definitely been a great help. On Thu, Apr 23, 2009 at 1:12 PM, Ben FS ben.su...@gmail.com wrote: Hi Sumit, Is there any reason why you couldn't just call treeItem.setWidget(b) ? Yes. See issue #2297 that I submitted one year ago. TreeItem.setWidget deletes state/content of the widget that is replaced http://code.google.com/p/google-web-toolkit/issues/detail?id=2297 In short, when you call TreeItem.setWidget, it deletes the content/ state in the DOM of the existing widget. For widgets that only store their state in the DOM (such as the Label), this is bad news. By default, when you supply text data to the Tree, it renders this text in each TreeItem as a Label. I want to dynamically modify an individual node (make it editable), and after editing or when a different node is selected, return the node to the original state. Let's say I do this: Widget normal = treeItem.getWidget(); // save this for later treeItem.setWidget(someEditor); // do some editing, then later in another event handler treeItem.setWidget(normal); The debugger will show that, as soon as setWidget executes, the text of the original Widget, in variable normal, has been erased. Refer to the issue I linked above to see the TreeItem source code that causes this effect. Again, it only matters for Widgets that store their state in the DOM (I don't know which these are, but I know it includes Label). That should change the tree item to the button widget and also properly register the click handlers on the button so that the handler is fired all the way out. Yes, and this does work. But I want to be able to make the change only temporary, and return the node to its original state after some time. I want it to be reversible. I tried various approaches in the past, and finally got one to work (i.e. appending a Button next to the existing Widget, but since TreeItem does not have an append method, I directly manipulate the DOM to achieve this effect in a reversable manner). This approach no longer works in GWT 1.6 - the
Re: Help
Check the Jetty log. Are you getting a 404 on the resource request? Also, I dunno why you are doing what you are doing with DockPanel, but in any case it's probably wrong. Every time you add a widget it'll append -parent to each child. So after 3 adds, the 1st child added will have class-parent-parent-parent. Also, that's a potential performance problem. Why aren't you setting the classname explicitly outside of dock panel. Or create a separate class with a dedicated method that'll properly set the style name as you want once, after all children have been added. Or if you want a more automatic approach, something like private boolean invalidated = false; void add(Widget w, Constraints c) { super.add(w, c); invalidated = true; DeferredCommand.addCommand(new Command() { public void execute() { if (invalidated) { invalidated = false; // refresh style names } }); } or even better create 1 timer schedule it on every addition, thereby bypassing invalidate the need to create a deferred command. On Fri, Apr 24, 2009 at 2:39 PM, grigoregeorge grigoregeorge631...@gmail.com wrote: Hello. I have a problem with my application. Why don't display all the 2 image in the Web Application Starter Project import java.util.Iterator; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.DockPanel; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.Widget; public class Test implements EntryPoint { private VerticalPanel northPanel=new VerticalPanel(); private VerticalPanel northPanelBackground=new VerticalPanel(); private DockPanel thePanel=new DockPanel(){ public void add(Widget widget, DockLayoutConstant direction){ super.add(widget,direction); Iterator it=getChildren().iterator(); while(it.hasNext()){ widget=(Widget) it.next(); com.google.gwt.user.client.Element cell=DOM.getParent (widget.getElement()); DOM.setElementProperty(cell, className, widget.getStylePrimaryName()+-parent); } } }; public void onModuleLoad() { northPanel.setSize(100%, 100%); northPanel.setStylePrimaryName(north); thePanel.setSize(100%, 100%); thePanel.add(northPanel,DockPanel.NORTH); RootPanel.get().add(thePanel); } } .north { background-image:url('banner.jpg'); background-repeat:no-repeat; height:100%; } .north-parent { background-image:url('bg.jpg'); background-repeat:repeat-x; height:150px; } --~--~-~--~~~---~--~~ 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: FileUpload - how to get status back from server??
Technically no. It's a limitation of the HTML spec. You could try the following hack (untested so dunno how practicle this is what pitfalls you might enounter - as the lkml people say, here be dragons): In your response, you could presumably return JSON objects which you can then eval in JSNI use overlay types to provide more Java-friendly access to them. Additionally, if you were super-crazy, it might be possible to try use the GWT RPC serializer to serialize the response on the server side then somehow get the GWT de-serializer on the client to parse the result into Java objects. On Fri, Apr 24, 2009 at 9:38 PM, TimOnGmail timbes...@gmail.com wrote: Hi all... I'm using FileUpload to upload a file to a servlet. The problem is, there can be a lot of different problems on the server side (IOExceptions, format errors, etc.), and I want to get those back to my GWT app. Problem is, it seems the FileUpload only reports back (via its Event mechanism) that text of a page that is returned in the response. I can't seem to get an error message, Exception object, status code, or anything like that; just a page of HTML, text, etc. Does anyone know if there is any way to report back status, other than return back some known text/XML in the response? Throwing an Exception on the server just returns the text of the stacktrace in the response. - Tim --~--~-~--~~~---~--~~ 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: onModuleLoad called when hitting Browser 'Back' button
No. When you hit back, you're browser is navigating to a new page so of course you lose all your current Javascript state (otherwise, you could potentially leak your state to other sites which at best might corrupt them at worst allow attackers to steal your visitor's data). On Fri, Apr 24, 2009 at 6:07 PM, Lakshmi tlakshmipr...@gmail.com wrote: Hi, I have been dabbling with GWT 1.6 for a few days now and I have a problem with the History mechanism. I wrote a small application which consists of 4 hyperlinks and a panel. The content of the panel changes depending on which hyperlink is clicked. Three of these are GWT defined hyperlinks which were created this way: new Hyperlink( Home,Home); The fourth is a html link containing href navigates the user to some external application. The history mechanism works properly when I navigate between the GWT hyperlinks. onHistoryChanged is called whenever they are clicked or when I use the 'Back' button between their navigations. However when I click on the html hyperlink and then the 'Back' button, I see that my application's url is loaded (http://localhost:8080/ KDDBrowser.html#Home http://localhost:8080/%0AKDDBrowser.html#Home), but onHistoryChanged is not called. Instead onModuleLoad is called. This, I think, means that a new instance of the module is now serving my request because of which the state that I had stored in my earlier instance of the module is now lost :( Since it is the same browser instance I had expected GWT to route all requests coming from the same browser instance to the same module instance (and hence call 'onHistoryChanged' instead of 'onModuleLoad') Is there no way of maintaining state when navigating away from a GWT application and back? thanks, Lakshmi --~--~-~--~~~---~--~~ 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: Can I make a ClickHandler for an AnchorElement?
GWT isn't designed to work at that level with native DOM events. The far easier approach would be to wrap the AnchorElement in a GWT widget (Anchorhttp://google-web-toolkit.googlecode.com/svn/javadoc/1.6/index.html?com/google/gwt/user/client/DOM.htmlfor instance). Otherwise, you have to deal with sinking events working with native Javascript events worrying about memory leaks, at which point, just use Javascript since GWT isn't really providing any benefits. On Fri, Apr 24, 2009 at 7:48 PM, Dr Hfuhruhurr dr.hfuhruh...@gmail.comwrote: It is straightforward to find an id-labelled element in the DOM by for example a command such as AnchorElement ae = Document.get().getElementById(link1); Now I want to capture clicks on this element, but I can't for my life find any way to register any kind of handler for events on a DOM element. Any ideas? (Yes I know this is not in the spirit of GWT, but I still want to do it. I want to generate a script that will work prebuilt html- documents, much like jQuery does. This is an experiment for my own understanding of GWT rather than how I will use it in the future. I promise I will not do this in production code.) --~--~-~--~~~---~--~~ 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: Request after request.
Seriously doubt it's a hosted mode mode issue. Which browser did you test web-mode with? Hosted mode actually launches a version of IE6, so using FF or IE7 may present different issues (for instance they might have a raised AJAX connection limit) The issue is purely on the client side. Are you calling getEvents (the one that sends of the request to the server) on the client-side more than once? On Thu, Apr 23, 2009 at 4:44 AM, davidst...@gmail.com davidst...@gmail.comwrote: Well, it really looks like a bug, cause when i compile it to browser it works properly ( meanwhile ). Thanks for your answers. On Apr 23, 10:05 am, Salvador Diaz diaz.salva...@gmail.com wrote: As Vitali said, there are some common pitfalls when trying to implement something along the lines of whatyou're trying to do. There have been plenty of discussions related to chat implementations and server-push. You might want to look at this docs: http://docs.codehaus.org/display/JETTY/GWT+RPC+Exampleshttp://code.google.com/docreader/#p=google-web-toolkit-incubators=go. .. And also comment on this bug if you have any problems or even if you succeed:http://code.google.com/p/google-web-toolkit/issues/detail?id=267 Hope it helps, Salvador On Apr 23, 9:40 am, davidst...@gmail.com davidst...@gmail.com wrote: I open two clients, and trying to send a message from one to another. So i have two requests hanging on server's side, and the third one trying to send the message. the server side is like this : @Override public ArrayListEvent getEvents( Integer sessionId ) { UserInfo user = getUserById( sessionId );; ArrayList Event events = null ; if( user != null ) { if( user.events.size() == 0 ) { try { synchronized( user ) { user.wait( 20*1000 ); } } catch ( InterruptedException ignored ) {} } synchronized( user ) { events = user.events; user.events = = new ArrayListEvent(); ; } } return events; } And the sendEvent() on the server side is like this : @Override public void sendEvent( Integer senderId, Integer recieverId, String message ) { System.out.println( senderId + entered the sendMessage method ); UserInfo reciever = getUserById( recieverId ); MessageEvent me = new MessageEvent( senderId , message ); if( reciever != null ) { synchronized( reciever ) { reciever.events.add( me ); reciever.notifyAll(); } } } So I have two clients opened in hosted mode. For debugging i put System.out.println( senderId + entered the sendEvent method ); command at the enter to sendEvent() method. And the message senderId entered the sendEvent method appeared, only when one of the clients exited the getEvents(). So maybe the problem is that both clients are opened at the same computer, or maybe it's because of hosted mode ? On Apr 22, 11:56 pm, Vitali Lovich vlov...@gmail.com wrote: Most browsers only support 2 outstanding AJAX events - that may be what you are running into. Without knowing what other calls you make, I cannot make a recommendation. One thing that does come to mind is that I hope you only call getEvents once on startup. On Wed, Apr 22, 2009 at 4:47 PM, davidst...@gmail.com davidst...@gmail.comwrote: Hi. I'm trying to implement chat on my GWT app. So client has getEvents() function implemented like this : public void getEvents( ) { networkSvc.getEvents( new AsyncCallback ArrayListEvent () { public void onSuccess( ArrayList Event events ) { handleEvents( events ); networkSvc.getEvents( this ); } public void onFailure( Throwable caught
Re: Eclipse Plugin Compile Button Stack Overflow
The problem has already been fixed in trunk. Maybe you could convince the developers to make a point release given the visibility frequency this issue has occured. On Thu, Apr 23, 2009 at 3:51 AM, mihai007 mihai@gmail.com wrote: oh well add me to the list. this should have priority as it turns the use of plugin useless if I can't compile any workarounds? On 8 Abr, 16:11, Brian hibr...@gmail.com wrote: Just installed the Google plugin for Eclipse, and hit the Compile button on my project. It gave me astackoverflowerror. Prior to using the plugin, I'd compile by hitting the Compile button in the hosted mode browser. In the Run/Debug Eclipse configuration, I have -Xss4k -Xmx256M Compiles worked fine with those flags and the Compile button from hosted mode. How do I set the Xss flag for use by the Compile button in the eclipse toolbar? I tried putting it in the Advanced section, but this just informed me it wasn't an appropriate gwt compiler option. This isn't stopping me from doing anything, as I can still compile from hosted mode, just curious how to set it up. I checked the plugin faq, but couldn't find anything there. --~--~-~--~~~---~--~~ 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: ImageBundle and the new war structure
There's no public folder as far as I'm aware - that's what the war directory is for. Images go in the same directory as your ImageBundle class. On Wed, Apr 22, 2009 at 2:51 PM, Sunil suba...@gmail.com wrote: I created a package hierarchy in the public folder which matches the package for the ImageBundle definition. The compiler gave me [ERROR] No matching image resource was found. It gave me the filenames that would have matched, and I have the files under the exact same matching path in the public directory. If I moved the images to the same source folder as the ImageBundle definition source, it works. Thanks Sunil. On Apr 22, 11:37 am, Salvador Diaz diaz.salva...@gmail.com wrote: They have to be in the public directory. Read the second bullet point in the New Project Structure section here: http://code.google.com/webtoolkit/doc/1.6/ReleaseNotes_1_6.html#NewFe... And for more information on ImageBundles: http://code.google.com/webtoolkit/doc/1.6/DevGuideUserInterface.html#... On Apr 22, 5:28 pm, Sunil suba...@gmail.com wrote: In GWT 1.6, where do you put the image files for the ImageBundle in the new war structure? I tried to put it in a subdirectory called images in the war directory, and set the @Resource annotation value to images/ That did not work. Do I need to create a subdirectory with the module name under the war directory? Thanks Sunil. --~--~-~--~~~---~--~~ 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: How to get the 'generated' html
No since those values are hidden in javascript. All the generated html view is I think is if you use Javascript to do a document.write to dynamically generate the HTML, which isn't what you are doing. You might find Firebug helpful - it lets you inspect the DOM CSS which is far more useful. On Thu, Apr 23, 2009 at 5:26 AM, Stephan stephanwes...@gmail.com wrote: Hi, Perhaps someone can help me the following issue: I fetch a html file from the server with a remote call and place this into the page (using setInnerHtml). The html contains widgets like input (type=text). After displaying the user can enter values. What I want is to get the entire html including the entered values - similar to what FireFox WebDeveloper plug-in does when you select 'view generated source'. All my efforts with innerHtml and the DOM object result into the static HTML being returned. Is there a way to get the 'generated' or 'dynamic' content as html? thanks, Stephan --~--~-~--~~~---~--~~ 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: what optimizations are needed to improve performance
Use the Duration class instead to fetch the time, although I doubt that's going to improve much. Of course it's faster to access pre-created objects than creating new ones. Casting is a no-op as far as I know (I can't think of a language right now off the top of my head where it wouldn't be). Well, not really a no-op - it's at most a variable assignment, but those are extremely cheap. On Thu, Apr 23, 2009 at 6:15 AM, denis56 denis.ergashb...@gmail.com wrote: do you think getting and updating precreated widgets from the table (getWidget(), casting) is faster than creating them anew? one more thing, the gwt documentation mentions that operations with type long are resource consuming (Heavy use of long operations will have a performance impact due to the underlying emulation.), but I am using long data types extensively (System.currentTimeMillis()) to apply behavior at some elements (blinking, page reloads). Could this contribute to noticeable lag? Is there a function that would return current time as int data type? Thanks On Apr 22, 11:30 pm, Vitali Lovich vlov...@gmail.com wrote: On Wed, Apr 22, 2009 at 4:39 PM, denis56 denis.ergashb...@gmail.com wrote: His, I am seeing above expected performance on my application that displays a table (17 x 17 Flextable, using only GWT widgets) of rows that should be updated (Timer, RPC) at 1 second intervals. While the application targets IE 6 which run somewhat slowly (updates tend to be perfomed about 3 times slower), for sake of fairness I must attest superior performance in Firefox 3. Are there common optimizations that help improve speed besides what was recently covered in thread http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa. .. I have already made sure: - to apply styles only when really needed to avoid browser redraws - to use table: fixed to improve table rendering (http:// groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/ 4e7ae69a917236a8/f3fa66ce621e9cb5?lnk=gstq=layout%3A +fixed#f3fa66ce621e9cb5 http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa... ) - to use Timer#schedule(1000) instead of timer#scheduleRepeating(1000) to process updates one at a time, as resources free up What else could one think of? Also, facing some memory leak issues (in IE 6) as there are a lot of objects (Labels, Composites) being created for each row update coming from server. It seems to be solved by reloading page every 30 minutes, but I am wondering if there is a better way to free up browser memory automatically and at certain intervals? If the structure of your table doesn't change, then pre-create those labels composites simply change the data being displayed. Otherwise, at least for IE, innerHTML is significantly faster (although you lose the ability to do widgets event handling gets more complicated) --~--~-~--~~~---~--~~ 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: i18n in client/server application
On Thu, Apr 23, 2009 at 3:24 AM, olel lauri...@engram.de wrote: What do you mean by the regular java way? The regular java way for i18n is to use a java.util.ResourceBundle together with some property files (i.e. application_de.properties and application_en.properties for german and english properties). This ResourceBundle won't work in GWT (see above). Maybe somebody else do understand my problem? I do understand it. So what exactly prevents you from using a ResourceBundle when you throw the exception on the server side? It's regular Java servlet code - has nothing to do with GWT. --~--~-~--~~~---~--~~ 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: How to remove the default blue border of TabPanel
Make sure you include your stylesheet in the module xml in the correct location. This has been discussed several times in the discussion forum. Optionally, a hack would be to mark the rule !important, but I'd really recommend doing it the correct way - it's not difficult. On Thu, Apr 23, 2009 at 4:34 AM, Salvador Diaz diaz.salva...@gmail.comwrote: Use firebug to inspect the compiled application, it will tell you what styles are being applied to the tabPanel and where they come from, you should be able to find what is taking over the style of your panel. Also, you might want to redefine all of the tabPanel and tabBar styles, take a look at the javadoc for a complete list: http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/ui/TabPanel.html http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/ui/TabBar.html Hope that helps, Salvador On Apr 23, 9:51 am, Qing zq.zhangq...@gmail.com wrote: gwt-windows-1.6.4. it's in right location, because other styles can be applied to the page. only this tab panel border style doesn't work On Apr 22, 12:49 pm, Jim jim.p...@gmail.com wrote: Which version of GWT is used? Make sure the css file is in the right location. Jim Xiehttp://www.leeonsoft.comForGWT ORMhttp:// code.google.com/p/dreamsource-orm/downloads/list On Apr 22, 12:38 pm,Qingzq.zhangq...@gmail.com wrote: Hi, I'm using TabPanel. It has a default blue border. I've edit css for it: .gwt-TabPanel { margin-top: 4px; border: none; width: 100%; text-decoration: none; } .gwt-TabPanelBottom { padding: 10px; display: block; border-width: 0px; border-color: #44;} .gwt-TabBar { padding-top: 2px; border-bottom: 4px solid #ff; background-color: #ff; } and i have set it to the panel weget: tabPanel.setStyleName(gwt-TabPanel); but the blue border is still there Any advice? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---