开发者

GWT 2.1 - Creation of a Progress Bar Cell & related DataProviders options

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 upd开发者_如何学PythonateRowData 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!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜