Question

This a variant for the classic "wait rpc call problem" in GWT.

I have done a complete CRUD screen in GWT, calling RPC to atack an Oracle database. It has one panel for the search criteria and the results table, and other for the detail fields. I swap the visiblity of both as i need to.

The results table is a CellTable and i call the "setVisibleRangeAndClearData" method to get the table populated, which that takes care for paging, column sort and so on (for example when i come back from an update RPC call i keep the range i came from).

I use to make the "synchro" by putting the "after code" in the "onSuccess" block of the RPC call (i.e. swaping the panels), but when calling "setVisibleRangeAndClearData", the cellTable by itself launches another RPC call to get new data which is out of my control. So, what happens is that i swap the panels (wich is immediate) and after that, the user sees the table data update, which is ugly.

So the question is: How can i control that? How can i wait or get called when the "setVisibleRangeAndClearData" is finisehd?

Thanks in advance,

David

Was it helpful?

Solution

  1. Showing the table right away and then populating it with data is not ugly - in fact, it's the right solution from a UI perspective. Users expect immediate result of their actions, and showing them a loading indicator immediately after they press the button is the right approach.

  2. CellTable has two methods you may find useful:

setLoadingIndicator() - your table should display it until the data arrives;

onLoadingStatusChange().

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top