Posts Tagged ‘table’

The RC2 of Ext JS 3.0, unveiled last June, 3 (that was just one day after the 0.7 version of CP2JavaWS, that brought management for automatic asynchronous and buffered remote access for TableView) provides a CRUD mode that is close to CP2JavaWS’s Direct2CP one (presented last July, 14, and completed August, 2 – I wasn’t aware of Ext JS new features at that time).

Using Ext JS we create a Reader object (manages deserializing/JSON to fields mapping), Writer (for serializing/fields to JSON mapping) and Store object (url of remote programs that manage read, create, update and delete). We can see examples here and there (RESTFull store), and simpler examples wihout server backend (Dynamic Form and binding from a local xml file). On the Proxy object we can also specify an index range (autoLoad), that allows buffered access (Buffer Grid).

The Ext JS architecture ensures a good separation and provides advanced customization of rendering and behaviours for master and detail views. However CP2JavaWS provides these specific features :

  • only one line of code needed to create a fully working CRUD master/detail view (see here the required code when using Ext JS), automatic asynchronous and buffered access, sorting, form (detail view) controls that depends from their property type (as with Ext JS’s Dynamic Form). We just have to specify the CP business class name. All of the Ext Js features are accessible from a unique component, that allows same level of customization : columns displayed in the table view, custom detail view if needed, custom remote service if needed (instead of the provided generic DAO service).
  • provides a generic DAO service that doesn’t require any coding or setting on the server side, works on the object level and manages full database access cycle (through Hibernate) – Ext JS’s RESTful Store demo just simulates a database using session. Then CP2JavaWS’s Direct2CP is probably the most suited for a Java backend (instant work without any coding nor config).
  • allows to call directly an existing Java application/business services layer (based on Spring or another container) as it works at object level, and without additional configuration.
  • manages complex objects (objects graphs with nested, heterogeneous collections and references) both on client and server side : it then allows to display/edit any nested property, using paths, and the generic detail view creates an editing field for all of these nested objects attributes. Next version of CP2JavaWS will allow to specify (restrict) the editables properties in detail view (as we still can for the table view) – for now we can either edit all the object’s graph properties, or pass a custom detail view (has then to manage controls creation).
  • provides management for technical or business (and multiple) key(s), without additional configuration. Hidding of id field(s) depending on the mode and editing step is automatic, as new id affectation.
  • manages retreiving of value/label pairs for combo lists and radio buttons groups (through a remote service or local data).
  • choose automatically proper control from combo lists and radio buttons.
  • completely free (a 329$ license per developper is required for Ext JS).

Moreover CP2JavaWS provides full Digest authentication (Basic only with Ext JS), automatic switch to JSONP if required, and full jsession id tracking per endpoint.

Note : support for in-table editing (instead of using a detail view), still available in Ext JS, will be added soon into Cappuccino’s CPTableView. In fact it is an historical feature of Next/Cocoa’s NSTableView (the proper delegate method is still listed – commented – in CPTableView). In the same way columns reordering is planned.

Ext GWT 2.0 (available since July, 9, and priced the same as Ext JS 3.0) includes the new buffered Grid View, Row Editor, and still allowed (thanks to its generation step) to easily add Java CRUD management on the server side. However we still have to write a lot of code (see the source code of GXT Grid Store Data Binding example – also not faster to load than a CP application) and we are then stick with GWT limitations compared with Cappuccino :

  • requires a generations step (not elegant and less smooth development cycle), whose generator isn’t open source,
  • generated javascript very hard to deep debug,
  • based on the old Swing components model (very limited compared with Cocoa concepts),
  • does not allow integrating with Cappuccino (we then lack high level features like evolved graphics engine, undo/redo, drag&drop, advanced and automatic layout management, delegation chain and powerful runtime, etc.).

By using Ext JS 3.0 (pure javascript), integration with Cappuccino is more likely, however it is of very limited interest from the previous statements (and CP2JavaWS’s Direct2CP mode still is built on top of standard/expected Cocoa delegate methods).

A new 0.9 version of CP2JavaWS is available :


– slight changes to the master/detail view, that is now fully compatible with the new CPTableView (that has been merged in the master branch). Compatibility with the older 0.71 version remains.

– now automatically adds an image background for the tableView columns’s headers when creating a master/detail view.

– added support for sorting to the tableView (the logic was still available in the CPTableViewDelegate and remote generic DAO service, however the new CPTableView does not yet implement sortDescriptors creation and change notification) : a CP2JavaWS category has been added to CPTableHeaderView, in order to manage mouse click in the the header view, and then set the current sort descriptor and send the sortDescriptorsDidChange notification to the tableView’s delegate.

Note : the header background does not reflect yet the sort order (no arrow).

The online demo has been updated.