Synchronizing visual components

Database application development is a feature of JBuilder Professional and Enterprise. Distributed application development is a feature of JBuilder Enterprise.

Several data-aware components can be associated with the same DataSet. In such cases, the components navigate together. When you change the row position of a component, the row position changes for all components that share the same cursor. This synchronization of components that share a common DataSet can greatly ease the development of the user-interface portion of your application.

The DataSet manages a "pseudo" record, an area in memory where a newly inserted row or changes to the current row are temporarily stored. Components which share the same DataSet as their data source share the same "pseudo" record. This allows updates to be visible as soon as entry at the field level is complete, such as when you navigate off the field.

You synchronize multiple visual components by setting each of their dataSet properties to the same data set. When components are linked to the same data set, they "navigate" together and will automatically stay synchronized to the same row of data. This is called shared cursors.

For example, if you use a JdbNavToolBar and a JdbTable in your program, and connect both to the same QueryDataSet, clicking the "Last" button of the JdbNavToolBar automatically displays the last record of the QueryDataSet in the JdbTable as well. If those components are set to different dataSet components, they do not reposition automatically to the same row of data. Several of the dbSwing components, including JdbNavToolBar and JdbStatusLabel, automatically attach themselves to whichever DataSet has focus.

The goToRow(com.borland.dx.dataset.ReadRow) method provides a way of synchronizing two DataSet components to the same row (the one that dataSet is on) even if different sort or filter criteria are in effect.