Declare your async RPC interface to return Request instead of void.
Then for each active async call keep track of the Request returned.
When you remove your panel, call the cancel method on the request(s).
If you do cancel in progress RPC calls you will get an IO exception on
your server because the client closed the IO channel and the servlet
is still trying to write to it. The somewhat hack solution I have is
to ignore these exceptions be defining the following in my RPC
servlet:
@Override
protected void doUnexpectedFailure(Throwable e) {
if (e instanceof IOException || (e.getCause() != null &&
e.getCause() instanceof IOException))
return;
super.doUnexpectedFailure(e);
}
On Apr 15, 6:46 pm, Vladimir <[email protected]> wrote:
> Hello All!
>
> I'm running into an issue that I can't figure out...Here is the
> scenario:
> 1. I'm using a SplitLayoutPanel
>
> RIGHT_PANEL (VerticalPanel):
> I'm creating a whole bunch of nested flextables (that's the only
> design I could use due to the nature of the input). Each flextable has
> elements (Labels) that have a certain background color. The color is
> set by making an asynchronous call to the backend. If the call is
> successful, I use the flextable's cellFormatter to set the particular
> cell's background.
>
> LEFT_PANEL (VerticalPanel that contains a Tree)
> Each tree item triggers the right panel to change its content by
> making it's own async call. Basically, I do rightPanel.remove(....) to
> remove the widgets that are already there, and then add the newly
> generated widgets.
>
> THE PROBLEM:
> Since the widgets in the rightPanel are set to make hundreds of async
> calls, when the rightPanel.remove(...) is called the async calls are
> still active! I see them making the calls to the backend.
>
> So, do I need to do anything else to completely remove the widgets
> from the DOM?? How is it possible that the async calls are still being
> made? I tried rightPanel.clear() as well, and that doesn't work
> either.
>
> Any help would be appreciated!
>
> Thanks!
> Vladimir
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> 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 [email protected].
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.