Reputation: 190
I want to make a CellTable that shows validation errors by changing CSS style on wrong cells. I have started working with this gwt showcase example. My problem is that validation is executed only when user changes a cell (overriding onBrowserEvent() and render() in the Cell class), but I need to run some validations that have to be executed when a button is clicked.
I suppouse that the way is calling to table.redraw() but i have no clue about how to access "ViewData" class in order to mark it as invalid without using bad practices.
Thanks in advance.
Upvotes: 4
Views: 1297
Reputation: 64541
It might be one reason they added Column#getCellStyleNames
a few days ago: http://code.google.com/p/google-web-toolkit/source/detail?r=10309
Another possibility is to have a "global" map of all errors and have the cells look up if the given value is invalid or not and decide how to render it (possibly also getting the exact error message from the look-up). When you click your button, you'd simply populate the map and redraw the table.
Upvotes: 3