Why does CellTable hold on to AsyncDataProvider instances ?

2011-02-11 Thread will0

Hi All 
I've got a fairly standard gwt 2.1.1 setup, a CellTable which is controlled 
by an Activity. Each time the Activity is instantiated on a place change, 
this creates a new AsyncDataProvider.

It appears the CellTable keeps a reference to _all_ the AsyncDataProviders 
it has ever come across. The effect is that when a CellTable has seen 
multiple Activities, it fires onRangeChange on each of these 
AsyncDataProviders, even though I no longer have a reference to these.

Is this supposed to happen?  I can understand wanting multiple displays for 
a DataProvider, but I can't see a reason for the inverse.

Best regards

Will Temperley

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Why does CellTable hold on to AsyncDataProvider instances ?

2011-02-11 Thread John LaBanca
You have to remove the cell table from the AsyncDataProvider when your
activity is stopped or cancelled:
AsyncDataProvider.removeDataDisplay(cellTable);

The way its implemented, AsyncDataProvider adds a RangeChangeHandler to the
cellTable.  How else would the CellTable know that the RangeChangeHandler is
no longer active?

Thanks,
John LaBanca
jlaba...@google.com


On Fri, Feb 11, 2011 at 9:51 AM, will0 willtemper...@gmail.com wrote:


 Hi All
 I've got a fairly standard gwt 2.1.1 setup, a CellTable which is controlled
 by an Activity. Each time the Activity is instantiated on a place change,
 this creates a new AsyncDataProvider.

 It appears the CellTable keeps a reference to _all_ the AsyncDataProviders
 it has ever come across. The effect is that when a CellTable has seen
 multiple Activities, it fires onRangeChange on each of these
 AsyncDataProviders, even though I no longer have a reference to these.

 Is this supposed to happen?  I can understand wanting multiple displays for
 a DataProvider, but I can't see a reason for the inverse.

 Best regards

 Will Temperley

 --
 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+unsubscr...@googlegroups.com.
 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 google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Why does CellTable hold on to AsyncDataProvider instances ?

2011-02-11 Thread will0
Great, thanks, that's what I was looking for.

Just this wasn't immediately obvious to me, perhaps because it wasn't 
mentioned in the docs:
http://code.google.com/webtoolkit/doc/latest/DevGuideUiCellWidgets.html#data-provider

Best,

Will

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.