Cappuccino CPTableView : source code

Posted: December 5, 2008 in IT/Dev
Tags:

In the dev source tree of Cappuccino we can finally get the source code of the CPTableView class. Its implementation is identical to the corresponding Cocoa class, the table requests its datasource delegate to get each cell value : [_dataSource tableView:self objectValueForTableColumn:_tableColumns[column] row:row]. Then the lines data cache has to be managed in the datasource implementation, if the data are retrieved through JSON calls, in order to prevent the application server from requesting the database for each new cell to display when scrolling up or down the table. We can simply maintain a dozen lines cells cache.

Update: We can now use the new CP2JavaWSTableViewDelegate component as CPTableView’s datasource for automatic cached access while scrolling in the table view. It allows fast browsing of tables with thousands of elements without stressing the application server nor database server, and without requriring any pagination !
No GWT component, JSF or other provides that feature yet : they all use pagination (data splitted into multiple pages), that is less practical, less intuitive and slower to reach the desired element (if you have thousands of elements you can’t have all pages number displayed, so you have to use many times forward/fast forward buttons).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s