Named Filters for Queries

Data sources defined in AXVW files can use optional restrictions that are enabled or disabled from Java Script code.

filter_named.png

To define an optional restriction, add a data source parameter, and use this parameter's name in the enabled attribute of the restriction:

<dataSource> ... <parameter name="hasAvailableCapacityOnly" dataType="verbatim" value="false"/> <!-- This restriction is enabled if the client passes the hasAvailableCapacityOnly parameter = true. -->
<restriction type="sql" enabled="hasAvailableCapacityOnly"
sql="EXISTS (select 1 from rmcat where rmcat.rm_cat = rm.rm_cat and rmcat.occupiable = 1) AND rm.cap_em > 0"/>
</filter>

To enable an optional restriction, specify in your JS code the parameter that enables the restriction:

panel.setParameter('hasAvailableCapacityOnly', Ext.get("occupancyAvailable").dom.checked);
panel.refresh();

Example view: http://localhost:8080/archibus/schema/ab-products/solutions/parts/grid/ab-ex-report-grid-sql.axvw