Re: can I use Class.forName and newInstance in GWT ?
No, you cannot. Dynamically instantiating classes would invalidate some of the goals of the GWT compiler. The GWT compiler builds a javascript application that only contains code for the actual call graph of your application. If you would be able to instantiante classes from arbitray Strings, it cannot determine the call graph anymore. This is not really a limitation. You can overcome this by using factories that create instances of a particular class given its name using a simple string comparison and GWT.create(). Of course, you need to know all at development time all the possible classes that you might need to instantiate. If later you want to add support for another class, you need to change the code and rebuild. But in that situation, you probably need to add additional logic to your app anyway. Unless of course your app is completely dynamic, but in that case you should ask yourself the question if GWT is the technology to use. Regards, Danny On 30 dec, 09:11, Didier Durand wrote: > Hi, > > You can't: if you go > tohttp://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html#Pac... > for Class, you will see that forName() is not emulated by GWT. > > regards > > didier > > On Dec 30, 7:33 am, metalhammer29a wrote: > > > > > > > > > can I use Class.forName and newInstance in GWT ? > > > static Employee create (String name) { > > try { > > return (Employee) Class.forName(name).newInstance(); > > } catch (Exception e) { > > throw new IllegalArgumentException ("Unable to instantiate" > > + name); > > } > > } -- 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.
Is GWT application gallery still maintained?
I've uploaded my application on http://gwtgallery.appspot.com/ more than a week ago and it still does not have appeared in the gallery. The most addition dates from June 7. Is this gallery still maintained? Thanks, Danny www.cellamea.eu -- 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: Ecryption best practices (server side, client side, password handling)?
Stefan has allready made some very good comments so I'm not going to repeat them. Some more additional thoughts. Regarding encrypting the data in the database. If a user does not trust you (yourself and any of the people that have access to your server) to look at his data in the database, why would he trust you when you make the claim that his data is encrypted in the database? Furthermore, encrypting the data precludes providing any form of application level support to your users. Unless your service is exactly providing extremely secure storage of confidential data, I dont' see any reason for encrypting the data in the database and in that case you should find some security experts to assist you. This of course does not mean that you should not take precautions against data being accessed by unauthorized people or data being disclosed. But that falls under traditional secure server deployment. I'm afraid that there is no easy and proven solution to protect the confidentiality and integrity of Internet based communication without https. The SSL//TLS protocols have been scrutinized by security experts. Unless you are such an expert, don't think that you can come up with something that is solid enough. I personally would not trust any security measure that has not been published and analysed by the security and encryption community. Danny www.cellamea.eu On 1 aug, 17:06, Stefan Bachert wrote: > Hi Sven, > > i did have similar thought in the past. > Encrypting the database base would solve any "Datenschutz" data > protection topic since the application provider would not be able to > even read the data of his customers. > However, I do not see any easy solution, yet. Just encrypting any > database data would destroy any orderings on indexes. > It would work when only using equivalence, but this is a hard limit. > > The point of encryption should be the server. > When you doing encryption on client side you must offer the encryption > and decryption algo, too. > So it is likely to loose more than to win. (And it is difficult to > implement encryption without having an integral data type as it is the > case with javascript). > > To hash the password on client side is equivalent as to put the > password in clear to the database. > You loose security when doing so. Any attacker would just send the > encrypted password, may be to a similar service using the same > approach! > > Any attacker could substitude the browser and code when he has a legal > access to the service. > So he can get the encryption algo and apply it to other users. > > The only thing which is under your control is the server. > > Stefan Bachert > http::/gwtworld.de > > Inquiries for professional GWT support are welcome. > I am sorry, I won't do free personal support. > > On 31 Jul., 19:07, Sven wrote: > > > > > Dear group, > > > I want to extend a GWT/GAE application by offering the option to > > encrypt information entered by the user on client side in the > > database. The goal is to increase trust when storing potentially > > sensitive data, e.g. to prevent that people who have access to the DB > > (like me) have read access to the stored information. > > > For client-side encryption using GWT I found this > > post:http://www.mooreds.com/wordpress/archives/000529 > > > However, others do not even recommend to compute password hashs on the > > client and propose to do that on the > > server:http://www.owasp.org/index.php/Hashing_Javahttp://stackoverflow.com/q.. > > > From user's perspective, I would not be comfortable with transmitting > > my data unencrypted to the server (even using HTTPS), as the server- > > side may for example log my information (and my password!). Especially > > for the password-part I would feel unconfortable, as many people tend > > to reuse their passwords (please no discussion about this :-)). > > > Currently, I see two options: > > a) Encrypt and decrypt the information on the client using JS/GWT. > > Pro: The password never leaves the browser, the unencrypted > > information never leaves the browser. Con: Depending on the size of > > the data the encryption/decryption may be slow; if loaded via HTTP, > > the JS code may be compromised, etc. > > b) Encrypt and decrypt the information on the server. Pro: Fast. Con: > > The information is transmitted unencrypted. > > > What would be your recommendation? > > > In case of server-side encryption, would it make sense to hash the > > password on client side and to use the hash to encrypt/decrypt? Or > > would that be a no-go? > > > What happens if the user forgets his/her password? All data lost, I > > guess? > > > I have no deep practical experience with cryptography, so I would > > appreciate any suggestions or pointers to resources in the web. My > > goal is not to have a bullet proof solution for highly sensitive > > information, but it should be an improvement compared to the current > > implementation (no HTTPs, no encryption). > > > Thanks > > Sven
Re: Do we have any Library for OpenID autentication(Authentication using Google accounts/Face book etc.)
I've implemented support for openID with special case for Google and Yahoo mail (www.cellamea.eu). I've written a servlet that uses openid4java to interact with the openid providers. I can make the code available. On this moment, it's not packaged in an isolated way, so it's not usable out of the box, but it shows what you need to do. I wanted also to provide support for Facebook, MSN, LinkedIn etc... but I don't think that they are pure openid providers and I have not yet found the time to investigate the peculiarities of their authentication protocol. Another possibility is to look at Janrain Engage , formerly known as RPX (www.janrain.com). They support a whole variety of authentication providers (that's their business). I looked at it at the time, but I could not figure out how to integrate it with a GWT frontend (interacting from GWT with the Janrain's popup), and with my backend. It would be great if Janrain could provide a GWT integration. Anyone from Janrain on this mailing list? On 29 jul, 07:00, V M wrote: > Hello GWT Users, > > I am just wondering if we have any Library to do authentication using OpenID > providers like Google accounts/Facebook. > > Here is what i am trying to do: > > * Create a site which needs log-in widget/page/module to customize UI for > Users. > > What is the best way to create a Login form in this case? > > I appreciate if you could point me to some examples. > > Thanks in advance. > > -V M -- 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: XML Validation directly
I use saxon from Michael Kay (www.saxonica.com) for programmatic XML validation. It's very good, but it does not proivided much more detailed error messages. You mention that you need this during development time. Do you want to validate XML files that you construct by hand before using them in your application? In that case, I would suggest to invest in a XML editor that provides validation. These generally provide much more detailed error messages, including the line numbers where the error occurs. I use XML Studio from Progress, but there are others out there (Altova XML Spy, probably also some open source or Eclipse plug ins). The investment in the license has been paid back multiple times in saved effort. On 28 jul, 23:52, John Ivens wrote: > Okay, I tried one which produces some pretty bad messages, I will search for > something better, maybe xerces. > > > > On Mon, Jul 26, 2010 at 5:59 PM, Jeff Chimene wrote: > > On 07/26/2010 04:09 PM, John Ivens wrote: > > > I know that this is off topic for GWT, but if anyone knows of how to > > > validate an XML file directly by using something like Apache Commons > > > Validation, but without needing to create a bean or a form, I would > > > appreciate knowing about it. Basically, we have XML files that we would > > > like to validate directly out of XML, but using a validation in XML (in > > > a seperate or the same file). The reason we want to do this is that > > > during development we would like to have a very quick way of generating > > > validation without needing to be constantly updating screens and forms, > > > just change the XML (in one file or two, depending on what resources are > > > out there). > > > > Thanks in advance... > > > Any validating parser will do what you want. hint: the google search > > term is in this answer. > > > > -- > > > 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 > > cr...@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 > cr...@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.
GWT service to manage your wine cellar on line
these types in your ValueObjects. These definitions are translated into Java enumerations and GWT ConstantsWithLookup interfaces/property files, such that you can work with expressions such as WineColor.RED or wine_color().get(wine.getColor.getCode()) to get the locale specific description. I want to express my deep gratitude and high esteem to the GWT team and all the people that have contributed to it. Without GWT, I would never be able to build this! Have fun! Danny Goovaerts www.cellamea.eu www.oobikwe.eu -- 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: Mixed content warning on Chrome (skull and bones)
Thanks, I'll go for the cache-control public solution that you suggest such that the users can be confident about the confidentiality. I've tested with FF3 and IE7. These browsers seem to persistently cache the js when cache-control public is set on the reply headers. I don't know about Chrome. Speedtracer shows "From cache :false" but I do find the components in the cache. I don't know how the mobile browser handle it, but the js files are probably too big anyway to be cached. Danny On 14 jul, 22:30, lineman78 wrote: > Agreed, I had not thought of the caching issue, although this could > also be fixed by having your server set the cache-control header to > public when serving static content(doesn't work in FF2). An example > of how to do this can be seen here: > > http://onjava.com/pub/a/onjava/2004/03/03/filters.html > > While I agree that the icon may be a little scary to uninformed users, > I think it is probably better that way for the reasons I specified > before. At the same time, I wish both IE and Chrome would specify > which parts of the page are not secure so that advanced users can know > if there is something fishy going on. Just last night I had 2 of my > friends who are very non-technical ask me about security when it comes > to using free wifi. They have no clue what SSL is and it is much > easier for me to tell them to not put in any sensitive information > unless there is a lock icon on their screen. In your purposes you are > only loading javascript that has not data through an unencrypted > connection, but what is to keep you from doing jsonp and sending > unencrypted data, which from the browsers perspective looks exactly > the same, loading a javascript file. But from the users perspective > one is sending personal information over an unencrypted connection and > they should be notified because it is fairly serious. > > On Jul 14, 1:51 pm, Danny Goovaerts wrote: > > > > > I'm not worried about the overhead for the encryption. I want to load > > the js over http because browsers do not cache content that is loaded > > over https. As my application is fairly large (800k, split into > > several deferred pieces, some of which are 200k) I want to have it > > cached as much as possible. This is not such an issue when using the > > application over Wifi, but it can be an issue when using it on mobile > > devices, provided they that they do caching of decent sized components > > (seehttp://www.yuiblog.com/blog/2010/06/28/mobile-browser-cache-limits/ > > ). > > > I'd just whish that Google had picked another icon than the red skull > > and bones. > > > On 14 jul, 20:30, lineman78 wrote: > > > > I believe this is expected behavior, even gmail does this if you have > > > https turned on. What is keeping you from using https for loading the > > > js? The browser doesn't know that the request you are sending doesn't > > > contain any sensitive data, therefore this is a desired behavior as > > > usually there is not real reason not to make a request once an SSL > > > session has been established because at that point a symmetric block > > > cipher is used which has very little overhead. > > > > On Jul 14, 10:17 am, Danny Goovaerts > > > wrote: > > > > > I've deployed my GWT application over https. To allow caching of the > > > > javascript files, I load the bootstrap script over http : > > > > > http://www.cellamea.eu/cellamea/</a> > > > > cellamea.nocache.js"> > > > > > As expected, this gives a"mixed content warning" on Internet Explorer. > > > > On Firefox and Safari, the site loads normally. > > > > On Chrome (version 6.0.458.1 dev) however, I get a red "skull and > > > > bones" icon in the URL address bar instead of the green padlock icon. > > > > I think that this is even more scary for the users than the mixed > > > > content warning on IE. > > > > > Is this the expected behaviour on Chrome or do should I do something > > > > different? > > > > > Thanks in advance, > > > > > Danny -- 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: Mixed content warning on Chrome (skull and bones)
I'm not worried about the overhead for the encryption. I want to load the js over http because browsers do not cache content that is loaded over https. As my application is fairly large (800k, split into several deferred pieces, some of which are 200k) I want to have it cached as much as possible. This is not such an issue when using the application over Wifi, but it can be an issue when using it on mobile devices, provided they that they do caching of decent sized components (see http://www.yuiblog.com/blog/2010/06/28/mobile-browser-cache-limits/ ). I'd just whish that Google had picked another icon than the red skull and bones. On 14 jul, 20:30, lineman78 wrote: > I believe this is expected behavior, even gmail does this if you have > https turned on. What is keeping you from using https for loading the > js? The browser doesn't know that the request you are sending doesn't > contain any sensitive data, therefore this is a desired behavior as > usually there is not real reason not to make a request once an SSL > session has been established because at that point a symmetric block > cipher is used which has very little overhead. > > On Jul 14, 10:17 am, Danny Goovaerts > wrote: > > > > > I've deployed my GWT application over https. To allow caching of the > > javascript files, I load the bootstrap script over http : > > > http://www.cellamea.eu/cellamea/</a> > > cellamea.nocache.js"> > > > As expected, this gives a"mixed content warning" on Internet Explorer. > > On Firefox and Safari, the site loads normally. > > On Chrome (version 6.0.458.1 dev) however, I get a red "skull and > > bones" icon in the URL address bar instead of the green padlock icon. > > I think that this is even more scary for the users than the mixed > > content warning on IE. > > > Is this the expected behaviour on Chrome or do should I do something > > different? > > > Thanks in advance, > > > Danny -- 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.
Mixed content warning on Chrome (skull and bones)
I've deployed my GWT application over https. To allow caching of the javascript files, I load the bootstrap script over http : http://www.cellamea.eu/cellamea/ cellamea.nocache.js"> As expected, this gives a"mixed content warning" on Internet Explorer. On Firefox and Safari, the site loads normally. On Chrome (version 6.0.458.1 dev) however, I get a red "skull and bones" icon in the URL address bar instead of the green padlock icon. I think that this is even more scary for the users than the mixed content warning on IE. Is this the expected behaviour on Chrome or do should I do something different? Thanks in advance, Danny -- 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: the button and its infoLabel problem...
I think that you need a deferred command to handle this. Limit your clickhandler to set the infoLabel to "Beginning" and then launch a deferred command who's execute method performs the search and then updates the label. In this way, the execution thread will finnish, causing the screen to be updated with the beginning label and then only the defrred command will be executed. On 8 jul, 05:26, Shelley wrote: > thank Andreas and Aditya for your explanation. > > however the problem has nothing to do with RPC, the "search operation" > i mentioned above is simply a local operation such as sort a large > chunk of data which will take seconds to completed. meanwhile the > client is unresponsive until the click OnClick() is completed, you can > simply simulate this situation by doing a " while loop". > > is there other way i can see the "beginning..." ? or GWT has the > ability to make UI responsive when it doing a time-consuming operation > in client? > > thanks. > > -Shelley > > On Jul 7, 8:44 pm, andreas wrote: > > > > > HeyShelley, > > > a bit of further information is missing but may it be that you issue > > an RPC between infoLabel.setText("Beginning"); and > > infoLabel.setText("Completed");? > > > If so you simply forgot the async nature of GWT RPC. Your code in > > onClick(...) will not sort of stop or wait until the RPC finishes and > > continue afterwards. That's why infoLabel.setText("Completed"); > > will be immediately executed after infoLabel.setText("Beginning"); > > and you're simply "way to slow" to see it. > > > What you could do instead is call infoLabel.setText("Completed"); > > in your onSuccess(...) in case I'm right with RPC or in the callback > > of whatever request you do for your search operation. > > > Andreas > > > On 7 Jul., 10:22,Shelley wrote: > > > > hello all: > > > i came across a strange problem which seems quite simple: > > > > i have a button and a label on a panel, the button has been > > > registered a listener: > > > > Button searchButton = new Button( "Search" ); > > > searchButton.addClickHandler( new ClickHandler() > > > { > > > @Override > > > public void onClick( ClickEvent event ) > > > { > > > infoLabel.setText("Beginning"); > > > //do a search operation here which will take more than > > > 5 seconds... > > > infoLabel.setText("Completed..."); > > > } > > > } ); > > > > that's all, but i never see the "Beginning“ on the label, but only > > > see the "completed...", seem the label will not refresh it's text > > > until onClick is finished? how can i achieved the function that > > > display "beginning..." first and "Completed..." when the operation > > > completed? > > > > thanks in advance. > > > > -Shelley -- 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: GWT and CSS
Magnus, standard.css is "added" after your style sheets are loaded. Unless your style definitions are more selective that the definitions in standard.css, the definitions in standard.css take precedence. There are to possible solutions - make your selectors more precise(googleon css priority for detailed descriptions, much better that I could do here) - mark your style definition as !important, for example, that's how I override the settings for .gwt-button .authenticate-button { background: white none !important ; margin:2px !important; } Danny On Jun 16, 8:54 pm, Magnus wrote: > Hi Sven, > > I think that's an issue for me. When I use addStyleName with padding/ > margin, it has no effect. I guess it's overwritten. However, copying > the standard.css sounds not nice to me. Isn't there another > (programmatical) solution? > > Magnus > > On Jun 16, 1:35 pm, Sven wrote: > > > > > Hi Magnus, > > > > So what is the way one should use CSS? Is it possible to "inherit" a > > > style into another style, e. g. "my-button" inherits "gwt-Button", so > > > that I just add my adjustments? > > > just try to use addStyleName() instead of setStylePrimaryName(). By > > this you preserve the default standard.css styling of your elements > > and you can add additional formatting. More specific, the button would > > still have the class gwt-Button followed by your specific class which > > you can add to any CSS file linked in the main page. > > > However, as GWT adds its standard.css as last css file you may still > > experience strage overruling of your styles (using Firebug helps to > > understand what is overruled by what). > > > If that standard.css overruling is an issue for you, my blog post > > "GWT's standard.css killed my page layout" may help you: > > > http://ililiililililii.blog.de/2010/05/12/gwt-s-standard-css-killed-m... > > > Sven -- 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: ClickHandler not called on second click
I think that I have found the underlying cause. In the ClickHandler, I disable and enable the button. This incorrectly sets the state of the button which then leads to the ClickHandler not being called. I have a workaround in my application by not reenabling the button in the ClickHandler if it already is enabled. For reference : see issues http://code.google.com/p/google-web-toolkit/issues/detail?id=2885&q=button%20click%20twice and http://code.google.com/p/google-web-toolkit/issues/detail?id=4992&q=clickhandler%20pushbutton On Jun 3, 8:52 am, Danny Goovaerts wrote: > I have filed an issue 4993 for this in the issue tracker. > > On Jun 2, 9:37 pm, Danny Goovaerts wrote: > > > > > I managed to isolate the code in a few classes which reproduce the > > problem. > > > Can I upload a zipfile (15k) somewhere? > > > On Jun 2, 5:27 pm, Olivier Monaco wrote: > > > > Danny, > > > > What your click handler does? May be it puts some (transparent) > > > element in front of the button... How do you use the PushButton? What > > > is the exact structure of panels? You need to build a test case to us > > > help you. > > > > Olivier > > > > On 2 juin, 08:02, Danny Goovaerts wrote: > > > > > I have not yet been able to isolate the code while reproducing the > > > > problem. It's probably related to the actual structured of the page. > > > > But I managed to get some more information using the debugger. > > > > > - The problem occurs when using a PushButton (constructed using the > > > > constructor PushButton(Image image)), not when using a simple Button > > > > - In the class CustomButton when the method onBrowserEvent is called > > > > for a MOUSUP event : > > > > ... > > > > case Event.ONMOUSEUP: > > > > if (isCapturing) > > > > isCapturing = false; > > > > DOM.releaseCapture(getElement()); > > > > if (isHovering() && event.getButton() == Event.BUTTON_LEFT) > > > > { > > > > onClick(); > > > > } > > > > } > > > > break; > > > > ... > > > > > isHovering() returns true at the first click while it returns false at > > > > the subsequent clicks > > > > > The method isHovering is implemented as follows > > > > > final boolean isHovering() { > > > > return (HOVERING_ATTRIBUTE & getCurrentFace().getFaceID()) > 0; > > > > } > > > > > At the first click getCurrentFace().getFaceID()) evaluates to 3, while > > > > at the subsequent clicks, it evaluates to 1. > > > > So there is probably something wrong in setting the correct face in > > > > the particular situation. > > > > > I hope that this can provide enough information to find the real root > > > > cause. > > > > > Danny > > > > > On Jun 1, 6:21 pm, Danny Goovaerts wrote: > > > > > > My application is quite large. The button is several "levels" deep, > > > > > i.e. in a FlowPanel which itself is in a HorizontalPaneI in a hierachy > > > > > of divs. I will try to isolate while still reproducing the error. > > > > > I would also try to step through the code in a debugger, but > > > > > unfortunaly for this I need to move the mouse from the page to > > > > > Eclipse, which prevents from reproducing the error. > > > > > Danny > > > > > > On Jun 1, 4:17 pm, Ranjan wrote: > > > > > > > Something like that should not have gone unnoticed for so long. > > > > > > Could > > > > > > you post your code snippet? > > > > > > > On Jun 1, 12:07 pm, Olivier Monaco wrote: > > > > > > > > Danny, > > > > > > > > I had no problem (in dev mode). Here is my test case: > > > > > > > > public void onModuleLoad() > > > > > > > { > > > > > > > Button b = new Button("click me"); > > > > > > > b.addClickHandler(new ClickHandler() > > > > > > > { > > > > > > > @Override > > > > > > > public void onClick(ClickEvent event) > > > > > > > { > > > > > > > RootPanel.get().add(new Label("clicked")); &g
Re: ClickHandler not called on second click
I have filed an issue 4993 for this in the issue tracker. On Jun 2, 9:37 pm, Danny Goovaerts wrote: > I managed to isolate the code in a few classes which reproduce the > problem. > > Can I upload a zipfile (15k) somewhere? > > On Jun 2, 5:27 pm, Olivier Monaco wrote: > > > > > Danny, > > > What your click handler does? May be it puts some (transparent) > > element in front of the button... How do you use the PushButton? What > > is the exact structure of panels? You need to build a test case to us > > help you. > > > Olivier > > > On 2 juin, 08:02, Danny Goovaerts wrote: > > > > I have not yet been able to isolate the code while reproducing the > > > problem. It's probably related to the actual structured of the page. > > > But I managed to get some more information using the debugger. > > > > - The problem occurs when using a PushButton (constructed using the > > > constructor PushButton(Image image)), not when using a simple Button > > > - In the class CustomButton when the method onBrowserEvent is called > > > for a MOUSUP event : > > > ... > > > case Event.ONMOUSEUP: > > > if (isCapturing) > > > isCapturing = false; > > > DOM.releaseCapture(getElement()); > > > if (isHovering() && event.getButton() == Event.BUTTON_LEFT) > > > { > > > onClick(); > > > } > > > } > > > break; > > > ... > > > > isHovering() returns true at the first click while it returns false at > > > the subsequent clicks > > > > The method isHovering is implemented as follows > > > > final boolean isHovering() { > > > return (HOVERING_ATTRIBUTE & getCurrentFace().getFaceID()) > 0; > > > } > > > > At the first click getCurrentFace().getFaceID()) evaluates to 3, while > > > at the subsequent clicks, it evaluates to 1. > > > So there is probably something wrong in setting the correct face in > > > the particular situation. > > > > I hope that this can provide enough information to find the real root > > > cause. > > > > Danny > > > > On Jun 1, 6:21 pm, Danny Goovaerts wrote: > > > > > My application is quite large. The button is several "levels" deep, > > > > i.e. in a FlowPanel which itself is in a HorizontalPaneI in a hierachy > > > > of divs. I will try to isolate while still reproducing the error. > > > > I would also try to step through the code in a debugger, but > > > > unfortunaly for this I need to move the mouse from the page to > > > > Eclipse, which prevents from reproducing the error. > > > > Danny > > > > > On Jun 1, 4:17 pm, Ranjan wrote: > > > > > > Something like that should not have gone unnoticed for so long. Could > > > > > you post your code snippet? > > > > > > On Jun 1, 12:07 pm, Olivier Monaco wrote: > > > > > > > Danny, > > > > > > > I had no problem (in dev mode). Here is my test case: > > > > > > > public void onModuleLoad() > > > > > > { > > > > > > Button b = new Button("click me"); > > > > > > b.addClickHandler(new ClickHandler() > > > > > > { > > > > > > @Override > > > > > > public void onClick(ClickEvent event) > > > > > > { > > > > > > RootPanel.get().add(new Label("clicked")); > > > > > > } > > > > > > }); > > > > > > RootPanel.get().add(b); > > > > > > } > > > > > > > What's your test case? > > > > > > > Olivier > > > > > > > On 1 juin, 08:07, Danny Goovaerts wrote: > > > > > > > > I have a button with a ClickHandler. When I move the mouse over > > > > > > > the > > > > > > > button and click the button, the ClickHandler is called. When I > > > > > > > do no > > > > > > > move the mouse away from the button, the ClickHandler is not > > > > > > > called on > > > > > > > any subsequent clicks. I have to move the mouse away from the > > > > > > > button > > > > > > > and b
Re: Getting the default DateBox() picker to advance year at a time
It's not necessary to write a custom DatePicker. It suffices to create a DatePicker with a custom MonthSelector. Here is my implementation // package eu.oobikwe.gwt.ui; import com.google.gwt.user.datepicker.client.CalendarModel; import com.google.gwt.user.datepicker.client.DatePicker; import com.google.gwt.user.datepicker.client.DefaultCalendarView; public class DatePickerWithYearSelector extends DatePicker { public DatePickerWithYearSelector() { super(new MonthAndYearSelector(),new DefaultCalendarView(),new CalendarModel()) ; MonthAndYearSelector monthSelector = (MonthAndYearSelector) this.getMonthSelector() ; monthSelector.setPicker(this) ; monthSelector.setModel(this.getModel()) ; } public void refreshComponents() { super.refreshAll() ; } } // package eu.oobikwe.gwt.ui; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.ui.Grid; import com.google.gwt.user.client.ui.PushButton; import com.google.gwt.user.client.ui.HTMLTable.CellFormatter; import com.google.gwt.user.datepicker.client.CalendarModel; import com.google.gwt.user.datepicker.client.MonthSelector; /** * A simple {...@link MonthSelector} used for the default date picker. Not * extensible as we wish to evolve it freely over time. */ public class MonthAndYearSelector extends MonthSelector { private static String BASE_NAME = "datePicker" ; private PushButton backwards; private PushButton forwards; private PushButton backwardsYear; private PushButton forwardsYear; private Grid grid; private int previousYearColumn = 0; private int previousMonthColumn = 1 ; private int monthColumn = 2 ; private int nextMonthColumn = 3; private int nextYearColumn = 4 ; private CalendarModel model ; private DatePickerWithYearSelector picker ; public void setModel(CalendarModel model) { this.model = model; } public void setPicker(DatePickerWithYearSelector picker) { this.picker = picker; } @Override protected void refresh() { String formattedMonth = getModel().formatCurrentMonth(); grid.setText(0, monthColumn, formattedMonth); } @Override protected void setup() { // Set up backwards. backwards = new PushButton(); backwards.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { addMonths(-1); } }); backwards.getUpFace().setHTML("‹"); backwards.setStyleName(BASE_NAME + "PreviousButton"); forwards = new PushButton(); forwards.getUpFace().setHTML("›"); forwards.setStyleName(BASE_NAME + "NextButton"); forwards.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { addMonths(+1); } }); // Set up backwards year backwardsYear = new PushButton(); backwardsYear.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { addMonths(-12); } }); backwardsYear.getUpFace().setHTML("«"); backwardsYear.setStyleName(BASE_NAME + "PreviousButton"); forwardsYear = new PushButton(); forwardsYear.getUpFace().setHTML("»"); forwardsYear.setStyleName(BASE_NAME + "NextButton"); forwardsYear.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { addMonths(+12); } }); // Set up grid. grid = new Grid(1, 5); grid.setWidget(0, previousYearColumn, backwardsYear); grid.setWidget(0, previousMonthColumn, backwards); grid.setWidget(0, nextMonthColumn, forwards); grid.setWidget(0, nextYearColumn, forwardsYear); CellFormatter formatter = grid.getCellFormatter(); formatter.setStyleName(0, monthColumn, BASE_NAME + "Month"); formatter.setWidth(0, previousYearColumn, "1"); formatter.setWidth(0, previousMonthColumn, "1"); formatter.setWidth(0, monthColumn, "100%"); formatter.setWidth(0, nextMonthColumn, "1"); formatter.setWidth(0, nextYearColumn, "1"); grid.setStyleName(BASE_NAME + "MonthSelector"); initWidget(grid); } public void addMonths(int numMonths) { model.shiftCurrentMonth(numMonths); picker.refreshComponents(); } } Danny On Jun 2, 8:31 pm, Jim Douglas wrote: > No, it's not possible, short of writing a custom DatePicker. You > might want to vote for this open issue: > > http://code.google.com/p/google-web-toolkit/issues/detail?id=3520 > > On Jun 2, 9:24 am, Rob Tanner wrote: > > > > > Hi, > > > I'm using a DateBox() widget for users to enter their date of birth. > > When the picker is displayed, on either side of the month/year > > displayed in the center top of the picker are the greater than and > > less than arrows for moving forward or backward, month at a time. I > > have not figured out anyway to add year at a time as well (25 or more > > years of moths is a lot of clic
Re: ClickHandler not called on second click
I managed to isolate the code in a few classes which reproduce the problem. Can I upload a zipfile (15k) somewhere? On Jun 2, 5:27 pm, Olivier Monaco wrote: > Danny, > > What your click handler does? May be it puts some (transparent) > element in front of the button... How do you use the PushButton? What > is the exact structure of panels? You need to build a test case to us > help you. > > Olivier > > On 2 juin, 08:02, Danny Goovaerts wrote: > > > > > I have not yet been able to isolate the code while reproducing the > > problem. It's probably related to the actual structured of the page. > > But I managed to get some more information using the debugger. > > > - The problem occurs when using a PushButton (constructed using the > > constructor PushButton(Image image)), not when using a simple Button > > - In the class CustomButton when the method onBrowserEvent is called > > for a MOUSUP event : > > ... > > case Event.ONMOUSEUP: > > if (isCapturing) > > isCapturing = false; > > DOM.releaseCapture(getElement()); > > if (isHovering() && event.getButton() == Event.BUTTON_LEFT) > > { > > onClick(); > > } > > } > > break; > > ... > > > isHovering() returns true at the first click while it returns false at > > the subsequent clicks > > > The method isHovering is implemented as follows > > > final boolean isHovering() { > > return (HOVERING_ATTRIBUTE & getCurrentFace().getFaceID()) > 0; > > } > > > At the first click getCurrentFace().getFaceID()) evaluates to 3, while > > at the subsequent clicks, it evaluates to 1. > > So there is probably something wrong in setting the correct face in > > the particular situation. > > > I hope that this can provide enough information to find the real root > > cause. > > > Danny > > > On Jun 1, 6:21 pm, Danny Goovaerts wrote: > > > > My application is quite large. The button is several "levels" deep, > > > i.e. in a FlowPanel which itself is in a HorizontalPaneI in a hierachy > > > of divs. I will try to isolate while still reproducing the error. > > > I would also try to step through the code in a debugger, but > > > unfortunaly for this I need to move the mouse from the page to > > > Eclipse, which prevents from reproducing the error. > > > Danny > > > > On Jun 1, 4:17 pm, Ranjan wrote: > > > > > Something like that should not have gone unnoticed for so long. Could > > > > you post your code snippet? > > > > > On Jun 1, 12:07 pm, Olivier Monaco wrote: > > > > > > Danny, > > > > > > I had no problem (in dev mode). Here is my test case: > > > > > > public void onModuleLoad() > > > > > { > > > > > Button b = new Button("click me"); > > > > > b.addClickHandler(new ClickHandler() > > > > > { > > > > > @Override > > > > > public void onClick(ClickEvent event) > > > > > { > > > > > RootPanel.get().add(new Label("clicked")); > > > > > } > > > > > }); > > > > > RootPanel.get().add(b); > > > > > } > > > > > > What's your test case? > > > > > > Olivier > > > > > > On 1 juin, 08:07, Danny Goovaerts wrote: > > > > > > > I have a button with a ClickHandler. When I move the mouse over the > > > > > > button and click the button, the ClickHandler is called. When I do > > > > > > no > > > > > > move the mouse away from the button, the ClickHandler is not called > > > > > > on > > > > > > any subsequent clicks. I have to move the mouse away from the button > > > > > > and back. Then the ClickHandler is called when I click again. > > > > > > > To investigate, I have added a MouseDownHandler and a > > > > > > MouseUpHandler. > > > > > > These are called on subsequent clicks, only the ClickHandler is not > > > > > > called. > > > > > > As the focus stays on the button, I have tried hitting the enter > > > > > > key. > > > > > > This triggers calling the ClickHandler. > > > > > > > I 've tried adding
Re: ClickHandler not called on second click
I have not yet been able to isolate the code while reproducing the problem. It's probably related to the actual structured of the page. But I managed to get some more information using the debugger. - The problem occurs when using a PushButton (constructed using the constructor PushButton(Image image)), not when using a simple Button - In the class CustomButton when the method onBrowserEvent is called for a MOUSUP event : ... case Event.ONMOUSEUP: if (isCapturing) isCapturing = false; DOM.releaseCapture(getElement()); if (isHovering() && event.getButton() == Event.BUTTON_LEFT) { onClick(); } } break; ... isHovering() returns true at the first click while it returns false at the subsequent clicks The method isHovering is implemented as follows final boolean isHovering() { return (HOVERING_ATTRIBUTE & getCurrentFace().getFaceID()) > 0; } At the first click getCurrentFace().getFaceID()) evaluates to 3, while at the subsequent clicks, it evaluates to 1. So there is probably something wrong in setting the correct face in the particular situation. I hope that this can provide enough information to find the real root cause. Danny On Jun 1, 6:21 pm, Danny Goovaerts wrote: > My application is quite large. The button is several "levels" deep, > i.e. in a FlowPanel which itself is in a HorizontalPaneI in a hierachy > of divs. I will try to isolate while still reproducing the error. > I would also try to step through the code in a debugger, but > unfortunaly for this I need to move the mouse from the page to > Eclipse, which prevents from reproducing the error. > Danny > > On Jun 1, 4:17 pm, Ranjan wrote: > > > > > Something like that should not have gone unnoticed for so long. Could > > you post your code snippet? > > > On Jun 1, 12:07 pm, Olivier Monaco wrote: > > > > Danny, > > > > I had no problem (in dev mode). Here is my test case: > > > > public void onModuleLoad() > > > { > > > Button b = new Button("click me"); > > > b.addClickHandler(new ClickHandler() > > > { > > > @Override > > > public void onClick(ClickEvent event) > > > { > > > RootPanel.get().add(new Label("clicked")); > > > } > > > }); > > > RootPanel.get().add(b); > > > } > > > > What's your test case? > > > > Olivier > > > > On 1 juin, 08:07, Danny Goovaerts wrote: > > > > > I have a button with a ClickHandler. When I move the mouse over the > > > > button and click the button, the ClickHandler is called. When I do no > > > > move the mouse away from the button, the ClickHandler is not called on > > > > any subsequent clicks. I have to move the mouse away from the button > > > > and back. Then the ClickHandler is called when I click again. > > > > > To investigate, I have added a MouseDownHandler and a MouseUpHandler. > > > > These are called on subsequent clicks, only the ClickHandler is not > > > > called. > > > > As the focus stays on the button, I have tried hitting the enter key. > > > > This triggers calling the ClickHandler. > > > > > I 've tried adding a DeferredCommand to the ClickHandler with a > > > > variaty of actions(remove focus, remove focus and set focus again), > > > > but this does not change anything. > > > > > Environment > > > > - GWT 2.0.3 > > > > - Vista > > > > - Chrome 6.0.408.1 dev / Firefox 3.5.9/ Internet Explorer 7.0 > > > > > There are several posts in this forum that describe a similar > > > > behaviour > > > > (e.g.http://groups.google.com/group/google-web-toolkit/browse_thread/threa...) > > > > but none have a solution. > > > > > Any idea how to solve this? > > > > > Thanks in advance, > > > > > Danny -- 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: ClickHandler not called on second click
My application is quite large. The button is several "levels" deep, i.e. in a FlowPanel which itself is in a HorizontalPaneI in a hierachy of divs. I will try to isolate while still reproducing the error. I would also try to step through the code in a debugger, but unfortunaly for this I need to move the mouse from the page to Eclipse, which prevents from reproducing the error. Danny On Jun 1, 4:17 pm, Ranjan wrote: > Something like that should not have gone unnoticed for so long. Could > you post your code snippet? > > On Jun 1, 12:07 pm, Olivier Monaco wrote: > > > > > Danny, > > > I had no problem (in dev mode). Here is my test case: > > > public void onModuleLoad() > > { > > Button b = new Button("click me"); > > b.addClickHandler(new ClickHandler() > > { > > @Override > > public void onClick(ClickEvent event) > > { > > RootPanel.get().add(new Label("clicked")); > > } > > }); > > RootPanel.get().add(b); > > } > > > What's your test case? > > > Olivier > > > On 1 juin, 08:07, Danny Goovaerts wrote: > > > > I have a button with a ClickHandler. When I move the mouse over the > > > button and click the button, the ClickHandler is called. When I do no > > > move the mouse away from the button, the ClickHandler is not called on > > > any subsequent clicks. I have to move the mouse away from the button > > > and back. Then the ClickHandler is called when I click again. > > > > To investigate, I have added a MouseDownHandler and a MouseUpHandler. > > > These are called on subsequent clicks, only the ClickHandler is not > > > called. > > > As the focus stays on the button, I have tried hitting the enter key. > > > This triggers calling the ClickHandler. > > > > I 've tried adding a DeferredCommand to the ClickHandler with a > > > variaty of actions(remove focus, remove focus and set focus again), > > > but this does not change anything. > > > > Environment > > > - GWT 2.0.3 > > > - Vista > > > - Chrome 6.0.408.1 dev / Firefox 3.5.9/ Internet Explorer 7.0 > > > > There are several posts in this forum that describe a similar > > > behaviour > > > (e.g.http://groups.google.com/group/google-web-toolkit/browse_thread/threa...) > > > but none have a solution. > > > > Any idea how to solve this? > > > > Thanks in advance, > > > > Danny -- 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.
ClickHandler not called on second click
I have a button with a ClickHandler. When I move the mouse over the button and click the button, the ClickHandler is called. When I do no move the mouse away from the button, the ClickHandler is not called on any subsequent clicks. I have to move the mouse away from the button and back. Then the ClickHandler is called when I click again. To investigate, I have added a MouseDownHandler and a MouseUpHandler. These are called on subsequent clicks, only the ClickHandler is not called. As the focus stays on the button, I have tried hitting the enter key. This triggers calling the ClickHandler. I 've tried adding a DeferredCommand to the ClickHandler with a variaty of actions(remove focus, remove focus and set focus again), but this does not change anything. Environment - GWT 2.0.3 - Vista - Chrome 6.0.408.1 dev / Firefox 3.5.9/ Internet Explorer 7.0 There are several posts in this forum that describe a similar behaviour (e.g. http://groups.google.com/group/google-web-toolkit/browse_thread/thread/aa9ce024e173390e/65802ce6da9482e7?lnk=gst&q=second+click#65802ce6da9482e7) but none have a solution. Any idea how to solve this? Thanks in advance, Danny -- 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: Facing problem tackling browser refresh
I faced exactly the same problem (see http://groups.google.com/group/google-web-toolkit/browse_thread/thread/36979a4e8e51fdc5# ) I concluded that in case of a refresh, the async call is cancelled in the browser before it has concluded. I solved the problem by "waiting" until the onSuccess() of the callback was called. This waitingf is implemented by using a timer that fires repeatdly until it is stopped in the onSuccess() method of the RPC callback. Here is the main piece of code //code called in the ClosingHandler final AsyncCompletionFlag flag= new AsyncCompletionFlag() ; SessionGWTInterface.Util.getInstance().transfersSave(xml.toString(), new AsyncCallback() { public void onFailure(Throwable caught) { flag.setDone() ; return ; } public void onSuccess(String result) { flag.setDone() ; return ; } }) ; //We need to have this to be sure to continue running until the RPC completes. If not, it can be cancelled before //it acttually runs AsyncCompletionChecker checker = new AsyncCompletionChecker(flag) ; checker.run() ; package eu.oobikwe.gwt.rpc; import com.google.gwt.user.client.Timer; public class AsyncCompletionChecker extends Timer{ private static int WAIT_TIME = 10 ; private int waitTime ; private AsyncCompletionFlag flag ; public AsyncCompletionChecker(AsyncCompletionFlag flag) { this(flag,WAIT_TIME) ; } public AsyncCompletionChecker(AsyncCompletionFlag flag,int waitTime) { super(); if(waitTime > 0) { this.waitTime = waitTime; } else { this.waitTime = WAIT_TIME ; } this.flag = flag ; } @Override public void run() { if(!flag.isDone()) { this.schedule(waitTime) ; } } } package eu.oobikwe.gwt.rpc; public class AsyncCompletionFlag { private boolean done ; public AsyncCompletionFlag () { super() ; done = false ; } public boolean isDone () { return done ; } public void setDone() { done = true ; } } This works for me. On 20 apr, 09:24, chill_hus wrote: > Hi > I am working on an application which uses GWT 2.0, gwt-comet & GXT > I have added a close handler (Window.addWindowClosingHandler) to > detect refresh and closing of browser > When this handler is called I do a RPC to a servlet. > This RPC is executed properly if the browser tab is closed. However in > case of refresh it is inconsistent. Few times RPC is executed while > some times it doesn't and onFailure (of AsyncCallback) is called and > StatusCodeException is thrown > Is there any thing wrong in my implementation. pls help me out with > this situation. > Thanks in advance for 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.com. > For more options, visit this group > athttp://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: Async RPC during CloseHandler.onClose() cancelled?
Moving the reload to the onSuccess is a good suggestion. Thanks! On 16 apr, 18:12, Thomas Broyer wrote: > On Apr 16, 5:44 pm, Danny Goovaerts wrote: > > > > > > > In the application that I'm building I've implemented a > > CloseHandler.onClose() which saves the local state in the database at > > the server side. This state is reloaded automatically when you log on > > the next time (fromthe same browser or from another browser, that's > > why I am not storing it in a cookie in the client). > > > This all works as expected when you close the browser (or the browser > > tab) or when you navigate to another url. > > The application is supported in multiple languages . I switch language > > by replacing the URL by a new URL with locale query parameter (for > > example, the URL for the default language ishttp://www.mysite.eu/, > > the URL for the french version ishttp://www.mysite.eu/?locale=fr). > > This causes a reload and the application is reinitialized in the new > > locale. > > > However in this case, the async call in the CloseHandler.onClose() > > method apparently is not called or it is called, but it is cancelled. > > I'm convinved that it is called but it is cancelled as a result of a > > timing issue. > > I've done the following tests: > > * in web mode, the problem occurs > > * in web mode, when I have emptied the browser cache, the problem does > > not occur > > * in hosted mode when I step through it in the debugger, the > > CloseHandler.onClose() method is called and the RPC succeeds > > * in hosted mode, not in the debugger, the RPC succeeds > > * I've also tried moving the RPC call in a Window.closingHandler where > > I set a message in the ClosingEvent. This causes a popup window. In > > this case, the RPC call also succeeds > > > This leads me to the conclusion that in in Web mode, the reload > > happens fast when the HTML page and the java script are cached, and > > that this causes the RPCto be canceled. > > > What do you think? > > > Is there a way to prevent the RPC call from being cancelled? > > Using onClose to save things is unreliable and risky (you'd better > have an explicit "save" button and in case you have unsaved changes > ask the user to save them before "closing", using a ClosingHandler). > > In the case where you reload the app (with a slightly different URL), > why not doing the RPC and do the reload in the onSuccess? (and because > you have no unsaved changes, you don't need to save again in the > onClose, or warn/ask the user in the ClosingHandler) > > -- > 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 > athttp://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.
Async RPC during CloseHandler.onClose() cancelled?
In the application that I'm building I've implemented a CloseHandler.onClose() which saves the local state in the database at the server side. This state is reloaded automatically when you log on the next time (fromthe same browser or from another browser, that's why I am not storing it in a cookie in the client). This all works as expected when you close the browser (or the browser tab) or when you navigate to another url. The application is supported in multiple languages . I switch language by replacing the URL by a new URL with locale query parameter (for example, the URL for the default language is http://www.mysite.eu/ , the URL for the french version is http://www.mysite.eu/?locale=fr). This causes a reload and the application is reinitialized in the new locale. However in this case, the async call in the CloseHandler.onClose() method apparently is not called or it is called, but it is cancelled. I'm convinved that it is called but it is cancelled as a result of a timing issue. I've done the following tests: * in web mode, the problem occurs * in web mode, when I have emptied the browser cache, the problem does not occur * in hosted mode when I step through it in the debugger, the CloseHandler.onClose() method is called and the RPC succeeds * in hosted mode, not in the debugger, the RPC succeeds * I've also tried moving the RPC call in a Window.closingHandler where I set a message in the ClosingEvent. This causes a popup window. In this case, the RPC call also succeeds This leads me to the conclusion that in in Web mode, the reload happens fast when the HTML page and the java script are cached, and that this causes the RPCto be canceled. What do you think? Is there a way to prevent the RPC call from being cancelled? Thanks in advance, Danny -- 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.
Async RPC during CloseHandler.onClose()
I've implemented a CloseHandler to makes an async call to the server to store the loc -- 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: Unable to migrate GWT application to version 2.03 due to problem with internationalization
es_GTC is normally not a valid locale. The "country" part of a locale is the two character ISO country code. GTC is not a valid country code. A reason might be that GWT 1.5 was not strict about the country code format, and that 2.0 is much stricter. Danny On 19 mrt, 14:28, craige wrote: > I am trying to migrate a GWT 1.5 application (which definitely works > without problem) to 2.03 and I am having problems with the compilation > of the application. My application uses various locales which are > defined in the Main.gwt.xml file > > > > > > The problem comes when the compiler attempts to compile the locale > es_GTC and the file InternationalizationConstants_es_GTC.properties > > The error from the compiler was as follows : > > Validating newly compiled units > [ERROR] Errors in 'generated:// > 6156E89F6D1ADDBDACCA415E145F7A5A/com/google/gwt/i18n/client/impl/ > LocaleInfoImpl_es-gtc.java' > [ERROR] Line 10: The type LocaleInfoImpl_es is already > defined > [ERROR] Line 10: Syntax error on token "-", < expected > [ERROR] Line 10: Syntax error, insert ">" to complete > ReferenceType1 > > This previously worked with GWT 1.5. If I remove the locale > > > > from the Main.gwt.xml file, the application compiles and runs without > problem. It seems that the GWT compiler has a problem with the - > character in the name of the autogenerated java method which is > > public class LocaleInfoImpl_es-gtc extends LocaleInfoImpl_shared { > > Anybody got any suggestions? I've looked in the documentation for GWT > 2.x and there is nothing to indicate that this has changed. > > Thanks > > Craige -- 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: How do I use my own server in hosted mode instead of GWT's built-in Jetty instance?
When you run OOPHM without the built in Jetty, your RPC calls will go to your instance of Tomcat (or to be more precise, to the server that is listening on the port that you specify in the URL : "http://localhost:port/cellamea.html? gwt.codesvr=192.168.1.102:9997", The URL proposed in the Development Mode window is http://localhost/cellamea.html?gwt.codesvr=192.168.1.102:9997 supposing that you run your server on the standard port 80). Changes that you make to your code in the debugger will only affect client side code (after you refresh your browser). Changes to your server code are not picked up automatically by your instance of Tomcat. Depending on your deployment, you will need to rebuild/redeploy/restart your Tomcat (similar to pushing the "Reload web server" button in the Development Mode window in Eclipse). If you want to actually debug in Tomcat, start Tomcat in debugging mode and start a debugging session in Eclipse to a remote JVM. Changes to your code will similarly not be picked up by Tomcat , needing a rebuild/redeploy/restarts sequence. You can run your application in Web mode (without debugging the client side) or you can also debug your application in development mode without the built in server. It all depends what you need to investigate. Danny P.S. 2.0 is great. Thanks to everyone who contributed! On 10 dec, 21:40, Henry wrote: > How do I use my own server in hosted mode instead of GWT's built-in > Jetty instance? > In the plugin, I found the option to turn off use built-in server. > Then I start my own server (Tomcat with JAAS j_security enabled), but > it doesn't seem to pick up changes with my OOPHM firefox. > How do I get my server (Tomcat) to understand: > ?gwt.codesvr=localhost:9997 > > thx, > Henry -- 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: ReplacementString support for MultiWordSuggestOracle for 1.6
Sorry, I hit send too fast. I want to use replacementString with a MultiWordOracleSuggestion. This is not possible today, also not in RC 1.6. I currently workaround the issue by implementing a SuggestOracle embeds a MultiWordSuggestOracle. The implementation of requestSuggestions delegates to the embedded MultiWordSuggestOracle in the following way ... private MultiWordSuggestOracle oracle ; private HashMap suggestions ; private MyCallBack myCallBack ; ... public void requestSuggestions(Request request, Callback callback) { //delegate to myCallBack and intercept the responses myCallBack.setOcb(callback) ; oracle.requestSuggestions(request, myCallBack) ; } ... private class MyCallBack implements Callback { private Callback ocb ; public void setOcb(Callback ocb) { this.ocb = ocb; } public void onSuggestionsReady(Request request, Response response) { // Create a new response Response myResponse = new Response() ; LinkedList responses = new LinkedList() ; //MultiWordSuggestOracle returns the original suggestion as replacementString // we use this as key to look upthe actual suggestion that we want to provide for(Suggestion suggestion : response.getSuggestions()) { responses.add(suggestions.get(suggestion.getReplacementString ())) ; } myResponse.setSuggestions(responses) ; ocb.onSuggestionsReady(request, myResponse) ; } } This works, but it would be much easier if we could simply provide the replacementStrings to the MultiWordSuggestOracle. Issue 2695 actually submits this as an enhancement request. Its status is "accepted. Any chance that this can make it into 1.6? Thanks (not just for answers to this post but for the tremendous tool that GWT is) Danny On 22 mrt, 20:56, Danny Goovaerts wrote: > I want to usereplacementString with Issue 2695 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
ReplacementString support for MultiWordSuggestOracle for 1.6
I want to usereplacementString with Issue 2695 --~--~-~--~~~---~--~~ 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: Script error in IE 7 in web mode
Arend, Thanks for the reply. I've been able to pinpoint the place where the problem occurs and it is indeed in a class where I parse the XML reply coming back from the server. It was working fine previously in all browsers. The difference is that the XML is larger now. Maybe Internet Explorer has a limit on the size XML documents that it can handle. I will investigate further and post my findings. Danny On 5 feb, 16:45, Arend van der Veen wrote: > Hi Danny, > > I had a similar problem when I was parsing an XML document. In my case, I > was a little careless about trapping errors and casting classes. As it > turned out Safari and Firefox ignored the errors while IE generated an > error. I was able to identify the offending lines of code and rewrote them > and made sure that I caught all the errors. > > Hope this helps, > Arend > > On Thu, Feb 5, 2009 at 4:57 AM, Danny Goovaerts > wrote: > > > > > > > I have a GWT application that runs OK in hosted mode. When I compile > > it, it gives a script error on Internet Explorer 7. The compile > > version runs correctly in Firfox, Chrome and Safari. > > I've turned on script debugging in IE7 and it gives me the following > > message (translated from Dutch) > > -- > > Line : 2 > > Character : 23530 > > Error : Exception activated but not handled > > Code: 0 > > - > > > Can anyone point me to some documentation how I can further > > investigate what's wrong. The application is quite big, so it's not so > > easy to isolate the piece of code where it goes wrong. > > > Thanks, > > > Danny- Tekst uit oorspronkelijk bericht niet weergeven - > > - Tekst uit oorspronkelijk bericht weergeven - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Script error in IE 7 in web mode
I have a GWT application that runs OK in hosted mode. When I compile it, it gives a script error on Internet Explorer 7. The compile version runs correctly in Firfox, Chrome and Safari. I've turned on script debugging in IE7 and it gives me the following message (translated from Dutch) -- Line : 2 Character : 23530 Error : Exception activated but not handled Code: 0 - Can anyone point me to some documentation how I can further investigate what's wrong. The application is quite big, so it's not so easy to isolate the piece of code where it goes wrong. Thanks, Danny --~--~-~--~~~---~--~~ 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: Toggle visibility of a PushButton
The problem seems to be that I keep the Image in a static variable under the (probably wrong) assumption that I could save some memory when multiple of such buttons are used. Changiong the definition to public class AddButton extends PushButton{ public AddButton() { super( ImageCollection.getImagesInstance().add().createImage()) ; } } makes the button behave fully as expected. I don't need the deferred command anymore. So case closed. On 31 jan, 10:22, Danny Goovaerts wrote: > I've done some more testing. > The problem only occurs when I use a PushButton with an image from an > ImageBundle, > > public class AddButton extends PushButton{ > static Image image = ImageCollection.getImagesInstance().add > ().createImage() ; > > public AddButton() { > super(image) ; > } > > } > > when I use a PushButton with a text > > public class AddButton extends PushButton{ > static Image image = ImageCollection.getImagesInstance().add > ().createImage() ; > > public AddButton() { > super("add") ; > } > > } > > setVisible(true) works as expected. > > The setVisible is called from a changeListener on a ListBox. I've > moved the setVisible() into a deferedd command. The button is then > made visiblle, but the imag ein not displayed. > > Any suggestions? > > Thanks, > > Danny > > On 31 jan, 00:03, Danny Goovaerts wrote: > > > I have the follwing problem with PushButton. > > I hide it using setVisible(false). I then want to show it again using > > setVisible(true). But it is not shown. > > When I replace the PushButton by a regular Button it works as > > expected. > > Does anyone know the cause of this behavior and how to remedy it? > > > Thanks, > > > Danny --~--~-~--~~~---~--~~ 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: Toggle visibility of a PushButton
I've done some more testing. The problem only occurs when I use a PushButton with an image from an ImageBundle, public class AddButton extends PushButton{ static Image image = ImageCollection.getImagesInstance().add ().createImage() ; public AddButton() { super(image) ; } } when I use a PushButton with a text public class AddButton extends PushButton{ static Image image = ImageCollection.getImagesInstance().add ().createImage() ; public AddButton() { super("add") ; } } setVisible(true) works as expected. The setVisible is called from a changeListener on a ListBox. I've moved the setVisible() into a deferedd command. The button is then made visiblle, but the imag ein not displayed. Any suggestions? Thanks, Danny On 31 jan, 00:03, Danny Goovaerts wrote: > I have the follwing problem with PushButton. > I hide it using setVisible(false). I then want to show it again using > setVisible(true). But it is not shown. > When I replace the PushButton by a regular Button it works as > expected. > Does anyone know the cause of this behavior and how to remedy it? > > Thanks, > > Danny --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Toggle visibility of a PushButton
I have the follwing problem with PushButton. I hide it using setVisible(false). I then want to show it again using setVisible(true). But it is not shown. When I replace the PushButton by a regular Button it works as expected. Does anyone know the cause of this behavior and how to remedy it? Thanks, Danny --~--~-~--~~~---~--~~ 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 executing RPC call after updating to GWT 1.5.3
I've experienced the same problem. Be sure to use the 1.5.3 version of the gwt-servlet.jar in your Tomcat deployment. This fixed the problem for me. Danny a_martinez schreef: > Hi, > I developed an application with several services. After updating from > GWT 1.5.2 to 1.5.3 the RPC calls to the server doesn't work anymore. I > got an error message on server side: > > > java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 > at java.util.ArrayList.RangeCheck(ArrayList.java:547) > at java.util.ArrayList.get(ArrayList.java:322) > at > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract > (ServerSerializationStreamReader.java:617) > at > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.readInt > (ServerSerializationStreamReader.java:432) > at > com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.prepareToRead > (AbstractSerializationStreamReader.java:38) > at > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead > (ServerSerializationStreamReader.java:383) > at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:234) > at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall > (RemoteServiceServlet.java:163) > at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost > (RemoteServiceServlet.java:86) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter > (ApplicationFilterChain.java:252) > at org.apache.catalina.core.ApplicationFilterChain.doFilter > (ApplicationFilterChain.java:173) > at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter > (ReplyHeaderFilter.java:96) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter > (ApplicationFilterChain.java:202) > at org.apache.catalina.core.ApplicationFilterChain.doFilter > (ApplicationFilterChain.java:173) > at org.apache.catalina.core.StandardWrapperValve.invoke > (StandardWrapperValve.java:213) > at org.apache.catalina.core.StandardContextValve.invoke > (StandardContextValve.java:178) > at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke > (SecurityAssociationValve.java:175) > at org.jboss.web.tomcat.security.JaccContextValve.invoke > (JaccContextValve.java:74) > at org.apache.catalina.core.StandardHostValve.invoke > (StandardHostValve.java:126) > at org.apache.catalina.valves.ErrorReportValve.invoke > (ErrorReportValve.java:105) > at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke > (CachedConnectionValve.java:156) > at org.apache.catalina.core.StandardEngineValve.invoke > (StandardEngineValve.java:107) > at org.apache.catalina.connector.CoyoteAdapter.service > (CoyoteAdapter.java:148) > at org.apache.coyote.http11.Http11Processor.process > (Http11Processor.java:869) > at org.apache.coyote.http11.Http11BaseProtocol > $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java: > 664) > at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket > (PoolTcpEndpoint.java:527) > at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run > (MasterSlaveWorkerThread.java:112) > at java.lang.Thread.run(Thread.java:619) > > > > This is how I call the service: > > diversePanel.add(new Button("Pseudo Login", new ClickListener() { > public void onClick(Widget sender) { > RemoteTypeDefServiceAsync typeDefService = > (RemoteTypeDefServiceAsync) GWT.create(RemoteTypeDefService.class); > ServiceDefTarget target = (ServiceDefTarget) > typeDefService; > String serviceEntryPoint = GWT.getModuleBaseURL() > +"TypeDefService"; > target.setServiceEntryPoint(serviceEntryPoint); > AsyncCallback callback = new AsyncCallback(){ > public void onFailure(Throwable caught){ > Window.alert("Login failed."); > } > > public void onSuccess(Object result){ > Window.alert("Login ok."); > } > }; > typeDefService.pseudoLogin(callback); > } > })); > > Can someone tell me what is wrong now? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: After leaving TextBox to a Button it takes second click to get ClickListener to work
I have a similar problem. I hve a FlexTable with a ClickListener. The FlexTable is down inside a set of nested Widgets (DeckPanel/Composite/ DeckPanel/AbsolutePanel/FlexTable). Sometimes, the ClickListener is called simply when I click a row in the table. In other situations, I need to click the table row twice. Is there maybe a need that a Composite must call sinkEvents to correcly pass events? On 7 dec, 23:00, agnes Laffitte <[EMAIL PROTECTED]> wrote: > Please stop sending me emails. > > --- On Sun, 12/7/08, Yefim <[EMAIL PROTECTED]> wrote: > From: Yefim <[EMAIL PROTECTED]> > Subject: After leaving TextBox to a Button it takes second click to get > ClickListener to work > To: "Google Web Toolkit" > Date: Sunday, December 7, 2008, 1:50 PM > > Hi, > I simple cases where I have a TextBox and a Button on the same Panel > and no other listeners except ClickListener - I have no problem to > move mouse away from entered text to the Button and have ClickListener > working - as in many basic samples. > But when I have a panel with TextBoxes representing business data and > a set of Buttons in a separate Panel, it takes second click to make it > working after entering text - OR I need to move from TextBox to a > different widget after entering text and only then click on a Button. > It seems like there is a need for an event indicating complition of > text entry before Button accepts a ClickEvent. > Any suggestion how to fix 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Problem with ListBox in Internet Explorer 7
I have a ListBox which is on a tab in a TabPanel. The ListBox only shows one item, so it is actually a drop down. I have unexpected behaviour when disabling and enabling the ListBox. This is the scenario - The tab with the ListBox is not shown. - The value of the ListBox is updated as the result of a rpc (triggered by pushing a button) and the ListBox is then disabled by the onSuccess method of the callBack. - The tab with the ListBox is selected manually and shown. It renders the ListBox Correctly and it is disabled correctly (nothing happens when I hover the mouse over it nor when I click it). - Another tab is selected manually. This tab has a button. When pressed it enables the ListBox again. - When the tab with the ListBox is selected manually, the ListBox is rendered as enabled. - However, when I hover the mouse over the ListBox, the arrow that normally is highlighted is not. When I click the ListBox, the current value is highlighted but the dropdown list does not appear. This specific problem apparently depends on how the ListBox is added to the Tab.The ListBox itself is a Composite. For example, I can reproduce the problem when I put the ListBox in a VerticalPanel which is added to the tab. When I put it in an Absolute panel, the behaviour is as you would expect (the drop down list is shown when you click the ListBox). Also, when I use a simple ListBox (not as the Widget of a Composite) the erronous behaviour does not happen. I've tried to reproduce it with a simple panel, but I cannot make it happen. It is apparently related to the actual structure of the screen (Composit as widget of other Composites). Also, this problem does not happen in FireFox, Google Chrome nor Safari. The problem both happens in hosted mode as well as running in IE. Can anyone point of whet the cause of this problem might be and how I can solve 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---