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.

Reply via email to