Monday, February 28, 2011

Re: Upadate Data of CellList

I hold the list internally and add the incoming data to it. So it
works when I call updateRow(0, wholeList). But I dont won't the
browser force to render the whole list. Lets say initially the list
has 50 items, I dont want to render 500 items after 9 loads, but only
to render 50 for every load.

This is the doc for m.google.gwt.view.client.HasData.setRowData:

Set a values associated with the rows in the visible range.

This method does not replace all rows in the display; it replaces the
row values starting at the specified start index through the length of
the the specified values.

If I understand this right, it should to what I want, only update the
values for specific rows, but it also delete all others.

On Feb 28, 3:30 pm, Jeff Schwartz <jefftschwa...@gmail.com> wrote:
> How are you maintaining the reference to the list of data objects you want
> to render?
>
> On Mon, Feb 28, 2011 at 9:26 AM, Greg Dougherty
> <dougherty.greg...@mayo.edu>wrote:
>
>
>
>
>
>
>
>
>
> > Well, I haven't looked at the Showcase example, but I'd bet good money
> > that those null pointers are the result of your actions, not anything
> > in GWT.
>
> > Are you disposing of the data you got from the server after your call
> > to updateRow?  Remember, YOU are providing the data to the renderer.
> > That means you have to keep a copy of the data around for the renderer
> > whenever it wants it.
>
> > Greg
>
> > On Feb 25, 9:59 am, Andreas <koebe...@gmail.com> wrote:
> > > > If you're only adding to the end of the list, then keep track of how
> > > > many items you've already added, and call updateRowData (prevNumAdded
> > > > - 1, newData);
>
> > > Unfortunately this works only on initial filling. The second time I
> > > call this I've got nullPointers in my cell.render method for the first
> > > items added. This is another thing I dont understand: why is the
> > > render method call for my whole list and not only for the one that
> > > I've added in the updateRowData method and why the first 10 are null.
>
> > > Also I dont understand which method forces the list to re render?
>
> > > > If you're changing things / adding things in the middle, you can do
> > > > all sorts of complicated things to figure out where the changes are,
> > > > and only give your CellList the changes, but you're probably better
> > > > off simply replacing everything and letting CellList worry about it.
>
> > > Draw the whole list is not that good cause you have a short delay
> > > where the list disappears. And there must be  a way to get it work, as
> > > shown in the showcase example.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-toolkit@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-toolkit+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> --
> *Jeff Schwartz*http://jefftschwartz.appspot.com/http://www.linkedin.com/in/jefftschwartz
> follow me on twitter: @jefftschwartz

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment