borland Packages Class Hierarchy jbcl.dataset Package Index
java.lang.Object +----borland.jbcl.dataset.RowFilterResponse
Properties Methods
This class includes or excludes the current row. Rows that are not displayed in the current view are not removed from the DataSet, only from the current, filtered view of a DataSet. If a newly inserted row contains a value that excludes it from current filter criteria, it is stored in the DataSet, but is not displayed in the current view when posted.
This class is usually called from the DataSet object's filterRow event. You restrict the rows included in a view by adding a RowFilterListener and using it to define which rows should be shown. The default action in a RowFilterListener is to exclude the row. Your code should call the RowFilterResponse's add() method for every row that should be included in the view.
Example
The following code sample, taken from Tutorial: Adding and removing filters, demonstrates one use of this class.
void queryDataSet1_filterRow(ReadRow readRow, RowFilterResponse rowFilterResponse)
throws DataSetException
{
if (formatter == null || columnName == null || columnValue == null ||
columnName.length() == 0 || columnValue.length() == 0)
// user-specified filter values are all blank, so all rows are to be included
// in the DataSetView
rowFilterResponse.add();
else {
readRow.getVariant(columnName, v); // fetches row's value of column
String s = formatter.format(v); // formats this to a string
if (columnValue.equals(s)) // true means show this row
rowFilterResponse.add();
else rowFilterResponse.ignore();
}
}
The filterRow() method is called by JBuilder for each row as a DataSet is opened, and whenever a new or modified row is posted. The filterRow() method decides if the current row of the DataSet should be included in the view. The rowFilterResponse.add() method call adds it. To exclude it, call rowFilterResponse.ignore(). Because the ignore() method is the default, it is not necessary to explicitly add the else clause referencing it. It was added in this example to clarify usage.
public final void add()Call this method inside the filterRow() method to cause the row to be included in the current DataSetView (i.e. in the filtered view of the DataSet).
public final boolean canAdd()This method returns true if the row should be added to the DataSetView, otherwise, it returns false.
public final void ignore()Call this method inside the filterRow() method to cause the row to be excluded in the DataSetView (i.e. in the filtered view of the DataSet).