borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.dataset
java.lang.Object +----borland.jbcl.dataset.RowFilterResponse
Properties MethodsThis class includes or excludes the current row. Rows that are not displayed in the current view are not removed from the data set, 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 data set, but is not displayed in the current view when posted.
This class is usually called from the data set'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. 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 set field(s) are blank, so add all rows
rowFilterResponse.add();
else {
readRow.getVariant(columnName, v); // fetches row's value of column
String s = formatter.format(v); // formats this to a string
// true means show this row
if (columnValue.equals(s))
rowFilterResponse.add();
else rowFilterResponse.ignore();
}
}
The filterRow() method is called by JBuilder for each row as a data set is opened, and whenever a new or modified row is posted. The filterRow() method decides if the current row of the data set should be included in the view. To include it, call rowFilterResponse.add(). To exclude it, call rowFilterResponse.ignore(). The ignore() method is the default. A filterRow() method that never calls rowFilterResponse.add() will produce an empty data set. The ignore() method is the default, so it is not necessary to explicitly add the else clause referencing it. It was added in this example to clarify usage.
public void add()Call to include the current row of the data set in the current, filtered view.
public void ignore()Call to exclude the current row of the data set from the current, filtered view.