Question

I am in the process of creating a Progress Bar Cell that will work in a GWT2.1 CellTable. So far I have the cell rendering a simple html progress bar in a manner that is consistent with other cell renders. I need to somehow update the progress bar cell value after receiving a new value. Should I be using the updateRowData method on the AsyncDataProvider?

Also, is there a logical place to include the polling code within the CellTable/DataProvider/.. architecture? Maybe a PollingAsyncDataProvider or something. Please share your ideas!

Thanks for the response!

Was it helpful?

Solution

The AsyncDataProvider doesn't copy your data, it only references it, so you can modify the values in the provider directly if you don't want to use updateRowData. For instance, if you've already initialized your dataprovider with some list, like:

asyncDataProvider.updateRowData(0, listOfProgressValues);

you can still access the data in the provider directly with listOfProgressValues, like:

listOfProgressValues.set(2, 0.4)

However, the change won't appear unless you call redraw on the CellTable. I don't know of a way to redraw only a single cell, since the whole things is rendered in HTML.

I would place the polling code outside of the DataProvider, I think. I view the DataProvider idea as a mechanism for pushing data into a table, and that's it. I wouldn't want the DataProvider to be responsible for redrawing its displays or interacting with the rest of my program.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top