I'd suggest one change to this. I wouldn't collect all the rows to update (getUpdateRows()) before making the first call. Instead I'd find the first row to update (getNextRowToUpdate) and then get the next one in the onSuccess method when the first one has been processed. This would allow the user to change their selections while queries are running. With a query running time of one minute this would be something users might want to do. The end condition would then be that the getNextRowToUpdate would return null.
On Jan 11, 7:58 am, Lothar Kimmeringer <[email protected]> wrote: > Shivi schrieb: > > > My RPC calls take about a minute to complete in the backend , > > > hence it is essential to show the querying label and essential to show > > which row (which actually represents a machine) is being queried as it > > is being queried in the backend. > > Here some peudocode how I would solve it: > > UpdateRows[] rows = getUpdateRows(); > // lock GUI, etc. > callUpdate(rows, 0); > > private callUpdate(UpdateRows[] rows, int currentIndex){ > showCurrentProcessedRow(rows, currentIndex); > ServerServices.Util.getInstance().performRowUpdate(rows[currentIndex], > new AsyncCallback() { > public void onSuccess(Object result) { > currentIndex++; > if (currentIndex < rows.length){ > callUpdate(rows, currentIndex); > return > } > showSuccessMessage(); > unlockGUI(); > } > public void onFailure(Throwable caught) { > showErrorMessage(caught); > unlockGUI(); > } > }); > } > > } > > Regards, Lothar
-- 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.
