Since 1.4.0, the API widget support the 'params' parameter for the GeoPrisma.applyFilter and GeoPrisma.applyFilters methods and the ApplyFilter widget uses it. This demo shows a very simple example of what can be accomplished with this.

Here's how it works. The ApplyFilter widget reads each parameter sent and append them to the WMS GetMap (for SLD selection) and WFS GetFeature (for records in the grid). That way, they can be used on server-side by MapServer as run-time substitution variables.

In this demo, each person has 10 records, one for each year from 2001 to 2010. In the mapfile DATA, the records are grouped by name and geometry, and the sum of the assets is returned in a single record for each person. The WHERE clause is where both run-time variables are used (WHERE year >= %datestart% AND year <= %dateend%). When the the parameters are not set, the default values specified in the mapfile are used (1900 and 3000).

See the mapfile used in this demo as well as the config.xml and finally how the GeoPrisma.applyFilters methods are called in the sample.inc.js.