Thursday, November 29, 2012

Re: CellTable - how to avoid unnecessary onRangeChange events?

Magnus, Hi.

I didn't found an easy and simple solution for that.

In my application I wrote a "DataManager" which is an AsyncDataProvider and has some cache functionality. So when I get an onRangeChange event I just go to server when it's really needed, fetching only the missing range.

It do a lot of things, but only this class for me is getting 800 lines :( Of course, this cache functionality is smaller than this, but still complex.

I haven't tested yet the performance of my code.

I could share something with you, if you are interested in. 

Em quarta-feira, 28 de novembro de 2012 12h43min24s UTC-3, Magnus escreveu:
Hi,

I found that my CellTable sends unnecessary onRangeChange events in a specific situation:

- The data source changes, e. g. the user selects another chat room.
- The new row count is less than the old one.

Then, when calling the data provider's updateRowCount method the GWT code recognizes that the current range exceeds the row count and corrects the range somhow, triggering an onRangeChange event.
Independend of this, the application also as an idea which records to show and also sets the new range.

In the end, the page is loaded twice. Can we avoid this?

Magnus

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/2zj6-6KfK-kJ.
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