Chapter 10. Data-presentation (cell) widgets

 

This chapter covers

  • Defining data-presentation widgets and data cells
  • Creating new cell types
  • Using the data-presentation widgets
  • Sorting, paging, and retrieving data
  • Generating custom-cell table builders

Until this point, we’ve been building applications using regular UI widgets. This is fine for many tasks, but they’re not ideal for rendering large data sets. They’re somewhat heavyweight objects that take time to instantiate, as well as occupy memory. Modern web browsers can generally render a page containing dozens or even hundreds of widgets almost instantaneously, but if we try to draw a data set that’s made up of thousands of widgets, we could well encounter a perceptible delay while the data is rendered, or worse, receive a slow script warning (SSW).

We could handle this delay through the use of an incremental Repeating-Command to draw a few results at a time, which occasionally returns control to the browser to prevent a slow script warning (older versions of GWT used Incremental-Command). That’s an applicable approach if we’re performing a lot of computation in any particular step, but for drawing large data on the screen we now use cell widgets; an example is shown in figure 10.1.

Figure 10.1. Example of cell widget in action showing a CellTable of data together with ability to page through data

10.1. Understanding cells

10.2. Creating custom cells

10.3. Reviewing GWT’s cell widgets

10.4. Looking at a CellList

10.5. Walking through a CellTree

10.6. Browsing a CellBrowser

10.7. Constructing a CellTable

10.8. Building a DataGrid

10.9. Summary