Re: How to show a load screen during rpc call?
Hi, what I'd to is: 1.) Display an image with some loading... animation 2.) Start the RPC asynchronously, e.g. like tagDatabaseService.loadAllTagsForPerson(new TagQueryMessage( tagQuery), new AsyncCallbackTagListMessage() { public void onSuccess(TagListMessage result) { // HERE 3.) at the spot marked with //HERE, remove the image again and do something with the result you obtained via RPC Hope this helps... On Jul 2, 6:02 pm, crojay78 croja...@googlemail.com wrote: Hi, I need to load a few things from my server after a user gives input. Can somebody give an example how I can show a load screen as long as the rpc is not finished? I structured the app in mvp style ... any example would help me Best regards Thanks -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-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 show a load screen during rpc call?
Have a look at the following loading panel: http://www.sencha.com/examples/explorer.html - you can find the explorer src and the loading image here: http://www.sencha.com/products/gwt/download.php -- 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 show a load screen during rpc call?
This doesn't answer your question directly but it should give you some ideas: public abstract class ActionCallbackResultType implements AsyncCallbackResultType { @Override public final void onFailure(Throwable caught) { BusyIcon.hide(); Window.alert(RPC Error: + caught.getMessage()); handleFailure(caught); } @Override public final void onSuccess(ResultType result) { BusyIcon.hide(); handleSuccess(result); } /* Override to handle event failure result */ protected abstract void handleFailure(Throwable caught); /* Override to handle event success result */ protected abstract void handleSuccess(ResultType result); } On Jul 2, 7:02 pm, crojay78 croja...@googlemail.com wrote: Hi, I need to load a few things from my server after a user gives input. Can somebody give an example how I can show a load screen as long as the rpc is not finished? I structured the app in mvp style ... any example would help me Best regards Thanks -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-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 show a load screen during rpc call?
OK, I have not used RpcRequestBuilder yet and only used RequestBuilder to alter the target of the request. How exactly would you use RpcRequestBuilder to hide the panel? And also from what I understood RpcRequestBuilder has nothing to do with actually sending the request so displaying a panel on creation of the request is kind of a short moment too early. I think I'd stick to a combination of a subclass of RequestBuilder where in send() the panel is shown and an implicitly assigned custom abstract AsyncCallBack implementation where onSuccess()/onFailure methods hide the panel and delegate the onSuccess()/onFailure() to a subclass. This of course depends on two things: 1) usage of return type in async service interface 2) possibility to use a subclass of RequestBuilder in async service interface (not sure about that but I might give it a try) Andreas On 3 Jul., 23:27, Thomas Broyer t.bro...@gmail.com wrote: On 3 juil, 21:45, andreas horst.andrea...@googlemail.com wrote: This sounds really great Thomas, haven't tried that yet. Can this be done by subclassing RequestBuilder? And can I actually really use my subclass of RequestBuilder as return type in RemoteService methods? Would make me love the ability to use this return feature of GWT RPC even more! It's nothing to do with the return type of methods in your Async interface. I'm talking about RpcRequestBuilder, not RequestBuilder:http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/g... (and yes, it allows you to use your subclass of RequestBuilder; but IMO you'd rather show the popup in RpcRequestBuilder#doFinish (or maybe even earlier, such as in doCreate()), and wrap the RequestCallback in doSetCallback; but if you already have a RequestBuilder-subclass, then just return it from doCreate) -- 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 show a load screen during rpc call?
On 4 juil, 15:25, andreas horst.andrea...@googlemail.com wrote: OK, I have not used RpcRequestBuilder yet and only used RequestBuilder to alter the target of the request. How exactly would you use RpcRequestBuilder to hide the panel? And also from what I understood RpcRequestBuilder has nothing to do with actually sending the request so displaying a panel on creation of the request is kind of a short moment too early. Anyway, display will only be updated after your code is done processing the event and yield to the browser, so doing it before the new RequestBuilder or after the request.send() does change anything (provided you don't yield to the browser in between). I think I'd stick to a combination of a subclass of RequestBuilder where in send() the panel is shown and an implicitly assigned custom abstract AsyncCallBack implementation where onSuccess()/onFailure methods hide the panel and delegate the onSuccess()/onFailure() to a subclass. The advantage of RpcRequestBuilder#setCallback wrapping the RequestCallback passed in argument, rather than an abstract AsyncCallback, is that it doesn't change anything at the call site: your don't have to remember to use the MyAsyncCallback abstract class. Unless that's what you mean by implicitly assigned custom AsyncCallback. This of course depends on two things: 1) usage of return type in async service interface 2) possibility to use a subclass of RequestBuilder in async service interface (not sure about that but I might give it a try) You'd have to provide your own RpcRequestBuilder, overriding doCreate(), to use your own RequestBuilder subclass. Which means you can have void or Request method return type, because GWT-RPC will call send() itself on your subclass returned by doCreate. -- 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 show a load screen during rpc call?
This sounds really great Thomas, haven't tried that yet. Can this be done by subclassing RequestBuilder? And can I actually really use my subclass of RequestBuilder as return type in RemoteService methods? Would make me love the ability to use this return feature of GWT RPC even more! On 3 Jul., 02:23, Thomas Broyer t.bro...@gmail.com wrote: On 2 juil, 18:22, andreas horst.andrea...@googlemail.com wrote: You could show your load screen (for example a popup panel or even just a label) right after issuing the RPC and hide it in onSuccess() and onFailure(). And if you want the same panel to be shown in most cases, you could bake it into a RpcRequestBuilder that you then inject inside you RemoteService/Async, and that's it, nothing special to be done at the call site of your service's method. -- 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 show a load screen during rpc call?
On 3 juil, 21:45, andreas horst.andrea...@googlemail.com wrote: This sounds really great Thomas, haven't tried that yet. Can this be done by subclassing RequestBuilder? And can I actually really use my subclass of RequestBuilder as return type in RemoteService methods? Would make me love the ability to use this return feature of GWT RPC even more! It's nothing to do with the return type of methods in your Async interface. I'm talking about RpcRequestBuilder, not RequestBuilder: http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/user/client/rpc/RpcRequestBuilder.html (and yes, it allows you to use your subclass of RequestBuilder; but IMO you'd rather show the popup in RpcRequestBuilder#doFinish (or maybe even earlier, such as in doCreate()), and wrap the RequestCallback in doSetCallback; but if you already have a RequestBuilder-subclass, then just return it from doCreate) -- 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 show a load screen during rpc call?
Hi, I need to load a few things from my server after a user gives input. Can somebody give an example how I can show a load screen as long as the rpc is not finished? I structured the app in mvp style ... any example would help me Best regards Thanks -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-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 show a load screen during rpc call?
You could show your load screen (for example a popup panel or even just a label) right after issuing the RPC and hide it in onSuccess() and onFailure(). On 2 Jul., 18:02, crojay78 croja...@googlemail.com wrote: Hi, I need to load a few things from my server after a user gives input. Can somebody give an example how I can show a load screen as long as the rpc is not finished? I structured the app in mvp style ... any example would help me Best regards Thanks -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-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 show a load screen during rpc call?
On 2 juil, 18:22, andreas horst.andrea...@googlemail.com wrote: You could show your load screen (for example a popup panel or even just a label) right after issuing the RPC and hide it in onSuccess() and onFailure(). And if you want the same panel to be shown in most cases, you could bake it into a RpcRequestBuilder that you then inject inside you RemoteService/Async, and that's it, nothing special to be done at the call site of your service's method. -- 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.