Can you use CellTable#setVisibleRangeAndClearData() to clear the current
data and request the new data from the database?
http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/view/client/HasData.html#setVisibleRangeAndClearData(com.google.gwt.view.client.Range,
boolean)
<http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/view/client/HasData.html#setVisibleRangeAndClearData(com.google.gwt.view.client.Range,
boolean)>
Thanks,
John LaBanca
[email protected]


On Wed, Dec 22, 2010 at 7:25 AM, Opal <[email protected]> wrote:

> Hi,
>
> I use CellTable to display the data stored in db. Data are provided
> using AsyncDataProvider. The last row that is displayed is an empty
> row used to add the new entry to db. After adding the entry I download
> the data from visible range again to refresh the view.
>
> Here's how it's done:
>
> public void redraw() {
>        mt.redraw(); //an instance of CellTable
>        madp.getMovies(mt.getVisibleRange().getStart(), mt.getPageSize());
> //
> an instance of AsyncDataProvider
> }
>
> The getMovies() method:
> public void getMovies(final int offset, final int limit) {
>        AdminAsyncCallback<MovieResultDTO> cb = new
> AdminAsyncCallback<MovieResultDTO>() {
>
>        @Override
>        public void onSuccess(MovieResultDTO result) {
>                if (result != null && result.getMovies() != null && !
> result.getMovies().isEmpty()) {
>                        updateRowCount(result.getSize(), true);
>                        updateRowData(offset, result.getMovies());
>                } else {
>                        updateRowCount(0, true);
>                }
>        }
>        };
>        AdminService.Async.service().getMovieResultDTO(offset, limit, cb);
> }
>
> There's one problem. The last row isn't refreshed and it holds the
> entered data. This row is added to the list downloaded from db every
> time the data are refresed. And it has null values cause I see it in
> logs. How can I clean the cell table before it's repopulated?
>
> --
> 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]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://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.

Reply via email to