Re: AsyncCallback - returning values to enclosing block
Yep, I tried it too, but my wife didn't get the beer!!! On 16 jun, 15:07, Magnus wrote: > Hi, > > thanks, the mechanism is still too new for me. Now, after debugging > exactly what Thomas said (the return val was empty), I understand it. > > So one can never just fetch something from the server while being in a > process where the server's result is needed. > > Good example! :-) > > Magnus > > On 16 Jun., 14:52, aditya sanas <007aditya.b...@gmail.com> wrote: > > > LOL Thomas.[?] > > > That was great example to determine async calls. > > > anyway what you are saying is right. > > > Its a bad design to have a method which returns something and then make > > async call which > > > changes the state of some variable. > > > -- > > Aditya > > > On Wed, Jun 16, 2010 at 6:13 PM, Thomas Broyer wrote: > > > > On Jun 16, 1:09 pm, Magnus wrote: > > > > Hi, > > > > > because I cannot access a variable in the enclosing block from within > > > > an AsyncCallback method I found the following workaround with a class > > > > global variable, which I find very unpretty. How can one do this > > > > better? > > > > What is it that you don't understand in "asynchronous"? > > > > I mean, your getUsr call will *always* end after the "return > > > tmp_str_usr" statement. So, on the first call and until the server > > > responds and you AsyncCallback is called, you'll get the empty string > > > (initial value of the field); then AsyncCallback will change its > > > value, and on all subsequent calls until the server responds to the > > > new requests (and AsyncCallback will be called again) you'll get that > > > value. > > > > When you ask your wife to get you some beer, the beer won't be there > > > until your wife come back from the kitchen; and while she's gone, the > > > football match isn't paused and life continues. > > > > -- > > > 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. > > > 360.gif > > < 1 KBAnzeigenHerunterladen- Zitierten Text ausblenden - > > > - Zitierten Text anzeigen - > > -- 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: exchange image by browser
Actually, by using a conditional stylesheet (with the @if annotation) the result would be much cleaner. The browser will only receive a tailor made css, and your javascript will only be used for stuff it's intended for, not styling. On 16 jun, 03:21, Sky wrote: > I personally prefer to keep logic in the application's language. I > like to keep CSS for just styling and keep all my logic in JS. Is > there a particular reason you can't just use JS to detect which > browser is running and then grab the right ImageResource for the job > (in this case you then need one ImageResource for each browser)? Of > course, you don't have to comply with my own standards and as such you > would need to use conditional css as was kindly mentioned by fmod. > > :) > > On Jun 15, 7:38 pm, fmod wrote: > > > I did not try myself, but I think you need conditional > > css.http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm... > > > On Jun 15, 11:27 am, Stefan Bachert wrote: > > > > Hi, > > > > I would like to use ClientBundle and ImageResource. > > > But I would like to supply different images (under the same name) by > > > browser. > > > > Does anyone have an idea how this could be achieved easily? > > > > Stefan Bacherthttp://gwtworld.de > > -- 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: where to define domain objects
Actually, the shared package is introduced for stuff you use on both the client and the server side. So that's the place to put your domain objects (entity models or however you want to call them). The client package will work fine too, since everything in the client package will be (for now) compiled into bytecode and will be available on server side. But I'm not sure if that's done for backward compatibility and could be changed in the future. So, I would recommend 'shared'. Gr., Joost On 15 jun, 17:05, Denis wrote: > The domain object I mentioned needs some further clarification: > It's a serializable Data Transfer Object/Bean/POJO that will be > transferred across all layers: presentation, business, and > persistence. > > With this in mind, I put the domain package under \client following > the approach described in the book of 'Pro Web 2.0 Application > Development with GWT' > > On Jun 13, 11:08 am, Stefan Bachert wrote: > > > HiDenis, > > > It is absolutely clear where domain object are NOT located, in client > > and shared. Domain objects have nothing to do in GUI or client > > > for a very simple project I would put it under server. > > But in general I would put domain objects into a separate project. > > The reason is, in general there is more than one application possible > > dealing the same domain objects. > > > In general you have the following kind of objects on the server side > > which may build an own layer and thatfore projects. > > > Session objects (state of your gui, application dependant, may be > > persistent) > > > Application objects (application dependant, persistant) > > > Domain objects (application independant, persistant) > > > Stefan Bacherthttp://gwtworld.de > > > On Jun 11, 10:45 pm,Denis wrote: > > > > Hello, > > > > I am new to use GWT RPC. > > > I am going to define a domain object which will map to a database > > > table and be transported all across the layers from the data > > > persistence to business logics and finally GWT presentation layer. > > > > The question is where should I define those domain objects? Inside the > > > existing client/server/shared folders or add a new domain folder? > > > > Thanks. > > >Denis > > -- 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: where to define domain objects
Actually, the shared package is introduced for stuff you use on both the client and the server side. So that's the place to put your domain objects (entity models or however you want to call them). The client package will work fine too, since everything in the client package will be (for now) compiled into bytecode and will be available on server side. But I'm not sure if that's done for backward compatibility and could be changed in the future. So, I would recommend 'shared'. Gr., Joost On 15 jun, 17:05, Denis wrote: > The domain object I mentioned needs some further clarification: > It's a serializable Data Transfer Object/Bean/POJO that will be > transferred across all layers: presentation, business, and > persistence. > > With this in mind, I put the domain package under \client following > the approach described in the book of 'Pro Web 2.0 Application > Development with GWT' > > On Jun 13, 11:08 am, Stefan Bachert wrote: > > > HiDenis, > > > It is absolutely clear where domain object are NOT located, in client > > and shared. Domain objects have nothing to do in GUI or client > > > for a very simple project I would put it under server. > > But in general I would put domain objects into a separate project. > > The reason is, in general there is more than one application possible > > dealing the same domain objects. > > > In general you have the following kind of objects on the server side > > which may build an own layer and thatfore projects. > > > Session objects (state of your gui, application dependant, may be > > persistent) > > > Application objects (application dependant, persistant) > > > Domain objects (application independant, persistant) > > > Stefan Bacherthttp://gwtworld.de > > > On Jun 11, 10:45 pm,Denis wrote: > > > > Hello, > > > > I am new to use GWT RPC. > > > I am going to define a domain object which will map to a database > > > table and be transported all across the layers from the data > > > persistence to business logics and finally GWT presentation layer. > > > > The question is where should I define those domain objects? Inside the > > > existing client/server/shared folders or add a new domain folder? > > > > Thanks. > > >Denis > > -- 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: UiBinder and child widgets
Okay, fixed my problem already ;-) First of all, it seemes that you cannot implement both the HasWidgets and HasHTML interface. Well, you can, but the UiBinder will only accept the first one. This means that if you implement HasWidgets, HasHTML, you can only add child widgets. If you implement HasHTML, HasWidgets, you can only add HTML. This is quite easy to work around. Simply just implement HasWidgets and add all HTML using an HTMLPanel. Then the tricky part: My GroupBox is subclassed from AbsolutePanel, which already implements the HasWidgets interface. It seems though, that I have to declare that interface again in my GroupBox class, else UiBinder won't recognize it! (Is this a bug?) So the solution was simple: add the HasWidgets interface to the GroupBox class declaration and we're done! Hello World Show Clear Works like a charm now! On 15 jun, 15:10, Joost Bloemsma wrote: > Hi, > > I've made a very simple GroupBox widget which works fine. I can add it > in java to a panel, set caption and add widgets. But now I want to add > it in a UiBinder template file. > To enable it to contain HTML, I had to implement the HasHTML > interface. Now the following works fine: > > > > Hello World > > > > Next step; I want to be able to add child widgets from within my > template, eg: > > > > Show > Clear > > > > Even though my GroupBox class extends the AbsolutePanel class, which > implements the HasWidgets interface, it fails with the following > error: > Found widget in an HTML context > > Has anybody an idea how I can add child widgets in my UiPanel > template? How do I have to implement my container widget? > > Thanks, Joost -- 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: UiBinder and child widgets
Okay, fixed my problem already ;-) First of all, it seemes that you cannot implement both the HasWidgets and HasHTML interface. Well, you can, but the UiBinder will only accept the first one. This means that if you implement HasWidgets, HasHTML, you can only add child widgets. If you implement HasHTML, HasWidgets, you can only add HTML. This is quite easy to work around. Simply just implement HasWidgets and add all HTML using an HTMLPanel. Then the tricky part: My GroupBox is subclassed from AbsolutePanel, which already implements the HasWidgets interface. It seems though, that I have to declare that interface again in my GroupBox class, else UiBinder won't recognize it! (Is this a bug?) So the solution was simple: add the HasWidgets interface to the GroupBox class declaration and we're done! Hello World Show Clear Works like a charm now! On 15 jun, 15:10, Joost Bloemsma wrote: > Hi, > > I've made a very simple GroupBox widget which works fine. I can add it > in java to a panel, set caption and add widgets. But now I want to add > it in a UiBinder template file. > To enable it to contain HTML, I had to implement the HasHTML > interface. Now the following works fine: > > > > Hello World > > > > Next step; I want to be able to add child widgets from within my > template, eg: > > > > Show > Clear > > > > Even though my GroupBox class extends the AbsolutePanel class, which > implements the HasWidgets interface, it fails with the following > error: > Found widget in an HTML context > > Has anybody an idea how I can add child widgets in my UiPanel > template? How do I have to implement my container widget? > > Thanks, Joost -- 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.
UiBinder and child widgets
Hi, I've made a very simple GroupBox widget which works fine. I can add it in java to a panel, set caption and add widgets. But now I want to add it in a UiBinder template file. To enable it to contain HTML, I had to implement the HasHTML interface. Now the following works fine: Hello World Next step; I want to be able to add child widgets from within my template, eg: Show Clear Even though my GroupBox class extends the AbsolutePanel class, which implements the HasWidgets interface, it fails with the following error: Found widget in an HTML context Has anybody an idea how I can add child widgets in my UiPanel template? How do I have to implement my container widget? Thanks, Joost -- 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 to test runtime mode
Thanx Thomas. That's exactly what I needed! And why the *** didn't I find that myself :-( On Apr 21, 1:05 am, Thomas Broyer wrote: > On 20 avr, 12:41, Joost Bloemsma wrote: > > > Hi, > > > Can anyone tell me if there is any way to find out, at runtime, in > > what mode the application is running? > > I mean, I would like to test if my app is running in development mode > > or hosted mode. Depending on the result I would like to change some > > settings at runtime like logging level, add the gwt.codesvr url to the > > login/logout url for the userService and so on. > > Have a look at GWT.isScript(). > > -- > 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.
How to test runtime mode
Hi, Can anyone tell me if there is any way to find out, at runtime, in what mode the application is running? I mean, I would like to test if my app is running in development mode or hosted mode. Depending on the result I would like to change some settings at runtime like logging level, add the gwt.codesvr url to the login/logout url for the userService and so on. -- 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.