Only create the AsyncDataProvider once and not every time the search method is called. If you recreate the provider like above you would also need to remove the table from the old provider beforehand and then attach the table to the new provider. Otherwise the new provider will never execute.
I typically create DataProviders in the constructor, either as anonymous class or as a concrete class, or I create it lazily when needed and store it in a field. Depending on the situation I also override Widget.onLoad() and Widget.onUnload() and attach/remove the cell widget from/to the provider accordingly. That way the data provider always executes as soon as you attach the widget to the DOM. Regarding your strange behavior: Keep in mind that you are working asynchronous so two search requests do not have to complete in the same order they are executed. If the order is important to you, then you have to disable UI controls until a request completes (only send on request at a time) or you have to make sure that your code only populates the table with the result of the latest created request and skips all other results. -- J. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.
