borland Packages  Class Hierarchy  dx.dataset Package 

CalcFieldsListener interface

java.util.EventListener
   +----com.borland.dx.dataset.CalcFieldsListener

About the CalcFieldsListener interface

Methods  

This interface is used for notification that a row that contains a calculated column has been added to a DataSet, or that a row that contains a calculated column in a DataSet has been modified. When the notification is received, the listener can initiate a recalculation of that row.

This class differs from the CalcAggFieldsListener in that this class is used to do calculations on rows. The CalcAggFieldsListener class is used for calculations on aggregates.

Once this listener is set on a StorageDataSet, the name of the listener class is remembered. If another StorageDataSet opens the same table stream without having set a listener with the same class name, the StorageDataSet will be marked readOnly. The StorageDataSet can be made writable again by doing one of the following:

For more information, see DataSetException.NEEDS_RECALC.

CalcFieldsListener methods

Methods defined in this interface


CalcFieldsListener methods

calcFields(com.borland.dx.dataset.ReadRow, com.borland.dx.dataset.DataRow, boolean)

  public void calcFields(ReadRow changedRow, DataRow calcRow, boolean isPosted)
Called whenever a field value is modified or added in the listener's data set. The isPosted parameter indicates that the row is being posted. You may not want to recalculate fields on rows that are not yet posted.

Parameters:

changedRow
The current values in the row, including the field that was just added or modified.
calcRow
The values to be left in the row when calcFields returns. Typically, the code in calcFields only modifies values in the calculated columns of calcRow.
isPosted
Indicates whether or not the row is being posted.