Ümit,

That's exactly what I've done. I've overridden the method setRowData(int, 
List<T) of my internal CellTable since I have control over that instance.

But what if I had not? Like, what if the CellTable instance was a parameter 
or something?

Wouldn't it be interesting if HasData allowed the addition of another event 
type, one that would be fired after the table contents are changed?
Should I open an enhancement issue? 

On Saturday, July 7, 2012 11:34:16 AM UTC+2, Ümit Seren wrote:
>
> Why don't you override the updateRowData method of your custom CellTable 
> to fire the SelectionChangedEvent?
> The AsyncDataProvider will call updateRowData and this will call it on all 
> attached displays thus also your custom CellTable.
>
>
> On Thursday, July 5, 2012 4:02:50 PM UTC+2, Tiago wrote:
>>
>> Hello,
>>
>> I'm writing a custom Composite widget which contains a CellTable. This 
>> CellTable must always have an item selected. (I wrote an implementation of 
>> DefaultSelectionModel to achieve that). And every time the selection 
>> changes, a specific SelectionEventHandler must be invoked to perform some 
>> modifications in the widget - modifications which depend on the selected 
>> element.
>>
>> This CellTable must be populated with an AsynDataProvider which is given 
>> by "user code", so I can't really change it to adapt to my widget 
>> "internals".
>>
>> How can I make sure that the selection model will fire a 
>> SelectionChangeEvent every time the range changes and the new data 
>> is asynchronously set by the provider?
>> The main problem here is that my SelectionEventHandler must 
>> be executed after the asynchronous request completes, because it depends on 
>> the data loaded from the server. If I simply add another RangeChangeHandler 
>> to the CellTable, even if I add it after the one added by the 
>> AsyncDataProvider, that is not enough because it is likely to execute 
>> before the call to the server returns.
>>
>> I saw there's an addValueChangeHandler on AbstractHasData, which could 
>> help me I guess, but unfortunately it is package protected, and the javadoc 
>> gives the impression it only works for CellBrowser, not CellTable.
>>
>> Anyone has any idea that could help me?
>> If there was a way to add a handler that would react after the 
>> AsyncDataProvider calls updateRowData that would be great...
>>
>> Thank you very much,
>> -- 
>> Tiago Rinck Caveden
>>
>> 

-- 
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/-/izezLQ9KwH0J.
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.

Reply via email to