Keyboard navigation in GWT CellTable

為{幸葍}努か 提交于 2019-12-03 12:39:32

After quite a bit of work trying, we determined that CellTable was not extensible enough to do what we needed. We ended up extending GWT's Grid class, taking design cues from CellTable to make it perform well enough for our needs.

In our use case, 80% of page views will display less than 10 rows and we will never have more than 600 rows by 10 columns (< 0.5% of cases have more than 500 rows). Instead of a full-fledged flyweight pattern, we used a lazy loading pattern. When the Grid is initially populated, display-only widgets are used to show the data from the underlying value objects. A FocusHandler is attached to each display-only widget. When a user clicks or tabs into a display widget, the FocusHander swaps out the display-only widgets for that row with the editable widgets.

Display-only widgets are restricted to lightweight widgets such as TextBox and CheckBox, so rendering time is acceptable. 100 rows x 5 columns render in less than 2 seconds. SuggestBoxes, DateBoxes, and other Composites are limited to only being used as editable widgets.

Advantages

  1. Flexibility to use any of the standard widgets
  2. Extensibility - we're not limited by the implementation choices made in CellTable
  3. Ease of development - prototyped in less than 3 days of development
  4. Performs well enough to fit our needs
  5. Tabs work out of the box as you would expect

Disadvantages

  • Not as scalable as CellTable. This implementation is not going to render thousands of rows
  • We have to maintain it ourselves

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!