Funny Behaviour in GWT CellTable?
I've created a test case of my CellTable issue as a self contained panel that can easily be imported into any project:
http://pastebin.com/zDLPKUNh
I've also posted this question on Google Groups GWT discussions.
Basically I have two Date class fields in my row model, a startDate and an endDate. Each Date has two columns in the CellTable (called batchTable), one to display the actual date (a DatePickerCell) and the other being a text input cell for the time.
When the FieldUpdater of the startTime or endTime is fired we parse the value, save the new time and call batchTable.setRowData() with the updated object and row index.
The problem is that when FieldUpdater is fired, the cells do not update?
I specifically edited the FieldUpdater of the endTime cell to be an hour later than what it was set at.
I've checked as best as I can that all the gets and sets of the respective startDate and endDate are in order, but I'm thinking that there's something about CellTable I'm not getting.
Apologies if I've miss开发者_开发问答ed anything.
I'm running: GWT 2.3
I've tested it in the latest Chrome and IE9.
Regards,
Julian
According to the google docs it should be enough to just change the field in your object and then call
cellTable.redraw();
in the update() method.
You could also try to call setRowData on your ListDataProvider instead of your CellTable. However calling setRowData on the ListDataProvider would probably end up in a call to every added display of the ListDataProvider which would be the same as calling setRowData on the CellTable directly.
I faced the same problem. In my case I had visiblerange set incorrectly. First parameter is index and second parameter is length. Make sure those two are set up correctly. After that the cell table displays correctly. I did not need to call redraw.
精彩评论