Sorry, forgot to mention. This only happens when you have less than
one page of data.

On Jun 13, 10:22 am, Paul Stockley <[email protected]> wrote:
> I am seeing the same problem and have logged a bug.
>
> On Jun 13, 7:45 am, Jaroslav Záruba <[email protected]> wrote:
>
>
>
> > Hi
>
> > I made my first attempt to utilize CellTable, *AsyncListViewAdapter*<T> and
> > SimplePager<T>. And I feel like it is christmass to get something like that
> > right out-of-the box. :)
>
> > Thanks to this 
> > thread<http://groups.google.com/group/google-web-toolkit/msg/f6dd50e6c66a20eb>I
> > managed to display data, but my pager behaves badly. In situation when
> > the
> > 'rewind' button should be 'deaf' clicking it makes data disappear and
> > the 'loading' indicator shows up, loading, loading and loading till the end
> > of days.
> > (Same applies to the 'goto end' button.)
>
> > Is there some obvious answer to a rookie mistake?
>
> > Hopefully this will be easily readable...
>
> > protected class MyAsyncAdapter
> >   extends AsyncListViewAdapter<DTO> { �...@override
> >   protected void onRangeChanged(ListView<DTO> v) {
> >     // doesn't get called on go2start/go2end :(
> >     Range r = v.getRange();
> >     fetchData(r.getStart(), r.getLength());
> >   }}
>
> > private void addTable() {
> >   // table:
> >   CellTable<DTO> table = new CellTable<DTO>(10);
> >   table.addColumn(new Column<DTO, String>(new TextCell()) {
> >       @Override
> >       public String getValue(DTO myDto) {          return myDto.getName();
> >       }
> >     }, "Name");
>
> >   // pager:
> >   SimplePager<DTO> pager = new SimplePager<DTO>(table);
> >   table.setPager(pager);
>
> >   adapter = new MyAsyncAdapter();
> >   adapter.addView(table);
> >   // does not make any difference:
> >   // adapter.updateDataSize(0, false);
> >   // adapter.updateDataSize(10, true);
>
> >   VerticalPanel vPanel = new VerticalPanel();
> >   vPanel.add(table);
> >   vPanel.add(pager);
> >   RootLayoutPanel.get().add(vPanel);}
>
> > // success-handler of my fetching AsyncCallback
> > @Override
> > public void onSuccess(List<DTO> data) {
> >   // AsyncCallback<List<DTO>> has start field
> >   adapter.updateViewData(start, data.size(), data);
> >   if(data.size() < length)
> >     adapter.updateDataSize(start + data.size(), true);
>
> > }
>
> > Regards
> >   J. Záruba

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