borland Packages Class Hierarchy dx.dataset Package
java.util.EventListener +----com.borland.dx.dataset.CalcFieldsListener
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 listener has to be added manually using the calcFields
event in the Inspector when any column in the data set is marked with a calcType
of calcType.aggregate
.
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:
StorageDataSet.recalc()
or StorageDataSet.restructure()
. This
will cause the system to forget the listener class name.
DataSetException.NEEDS_RECALC
.
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.
changedRow
calcRow
calcFields
returns. Typically, the code in calcFields
only modifies values in the calculated columns of calcRow
.
isPosted