Filter Response



Specifies a response variable for server-side filtering on paging grids. This enables programs controlling page-at-a-time grids to connect with the grid's column filtering user interface. The response is a data structure with column numbers and filtered text.

Promptable? NO
Possible Values: data structure response field
Bindable? YES
Products: ProfoundUI

If this property is not set, then client-side filtering is used on whatever data is loaded on the page. This should be used only for page-at-a-time grids, not for database-driven grids nor for load-all grids.

When this property is set, the grid will submit data to the server whenever a filter is set or removed. It is the responsibility of the server-side program to read the response, decide which column(s) to filter, and respond with filtered data.

This feature is available with Profound UI Version 6, Fix Packs later than 6.1.2.

Response Data

The filter response is packed into a fixed-length string that can be parsed into a data structure. The size of the structure depends on two grid properties: "filter response text max" and "filter response column max".

  • "filter response text max" - by default, 20. This is the maximum number of characters that will be read from a user's filter input on one column. If the user enters more than this amount, then the rest is truncated before sending the response. This should be at least 1. The value shouldn't be longer than the largest column in the grid.

  • "filter response column max" - by default, 3. This is the maximum number of columns that can have filters. This should be at least 1 and no more than the number of columns in the grid.

(The larger either of these are, the more data will be transmitted between the client and server when filters are set.)

Zero-padded column numbers are the first part of the response, followed by the filter text, which is right-padded with spaces. If the user did not specify a filter, then the entire field is blank. Columns in the response are numbered 1 for the first column filtered, 2 for the 2nd column filtered, etc.

The size of "filter response" must be calculated as follows:

c(3 + s)

Where "c" is the value of "filter response column max", and "s" is the value of "filter response text max". For example, if the default values of 3 maximum columns and 20-character maximum lengths are used, then the response field length should be: 3(3 + 20), which equals 69.

An example of using the filter response can be found in an example program in library PUISAMPLES. The display file is member GRID008D in file QDDSSRC. The RPG code is member GRID008R in file QRPGLESRC.

Data Structure

If the server-side program is written in RPG, then the following data-structure can be used to parse the response (after substituting the correct values for C and S):

Dcl-Ds filterinfo qualified; colnum zoned(3:0) dim(C); fltrtext char(S) dim(C); End-Ds;



Grid APIs that don't work with Paging Filters

Because paging filters are handled on server-side, some Grid APIs should not be used with paging grids when "filter response" is set.

  • isRowFilteredOut -This will return false for all rows, even if a the filter is applied.

  • setFilteredOut - This has no effect because it relates to client-side filtering

  • saveFilters - is meant for client-side filtering. On paging grid filters, the server-side program handles whether the filter is saved.

  • onfilterchange - This is meant for client-side filtering and does not fire when "filter response" is set. (The page submits when a user sets a filter on a paging grid, so there's no time to handle code even if this were enabled.)

Additionally, the grid filter behaves differently when "filter response" is set; the user must press enter when he/she is finished typing in the filter box.