Hi.
I'm working in a "page" that has some items that if the user clicks at
one, a table will be updated with an ajax call that brings the
information about the item clicked.
The problem is that when the user choose a item ( making the ajax call
A ) and them choose another ( making the ajax call B without waiting
for the first ajax call to complete ) sometimes the ajax call B
completes before the A one and them the widget updates the table with
the B data. After the A completes, the table updates with the A data
and thats the problem.
Is there a way to control that? I was thinking in abort the first call
but I really don't know how to do that. Has anyone come across with
this issue and has a good way to solve that?

The code:
dispatch.executeWithCache(new GetMedia(id),
                                new AsyncCallback<GetMediaResult>() {

                                        @Override
                                        public void onFailure(Throwable caught) 
{
                                                table.removeAllRows();
                                                table.setHTML(0, 0, "Connection 
Failure");
                                                t.cancel();
                                        }

                                        @Override
                                        public void onSuccess(GetMediaResult 
result) {
                                                t.cancel();
                                                if (result.getMediaList() != 
null) {
                                                        if (mediaList != null) {
                                                                
mediaList.clear();
                                                        }
                                                        mediaList = 
result.getMediaList();
                                                        $("#projects h1", 
getElement()).html("Conta <strong>" + id + "</
strong> com <strong>" + mediaList.size() + "</strong> campanhas");
                                                        initFill(15, 1);
                                                        if (status != null) {
                                                                updateTable(0, 
15, status);
                                                        }
                                                }
                                        }
                                });

-- 
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.

Reply via email to