Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Attrubute Search

Combination of checkboxes

Example of a combination of checkboxes. The combination will result in "OR" clauses rather than "AND" allowing combining different combinations. If there is no combination, e.g. only one checkbox is checked, the "whare clause" from that parameter will be used.

This works well when the options are few, 2-4, and static. User attributes are supported as arguments.

Code Block
languagexml
firstline1
titleCombination of checkboxes
linenumberstrue
<parameter id="active" type="checkbox" label="Active" >
	<where clause="status = 'active'"/>
</parameter>
<parameter id="inactive" type="checkbox" label="Inactive" >
	<where clause="status = 'inactive'"/>
</parameter>
<parameter id="done" type="checkbox" label="Done" >
	<where clause="status = 'done'"/>
</parameter>
<combination>
	<where clause="(status = (SELECT CASE WHEN '${active}' = 'true' THEN 'active' END) OR status = (SELECT CASE WHEN '${inactive}' = 'true' THEN 'inactive' END))"/>
</combination>
<combination>
	<where clause="(status = (SELECT CASE WHEN '${active}' = 'true' THEN 'active' END) OR status = (SELECT CASE WHEN '${done}' = 'true' THEN 'done' END))"/>
</combination>
<combination>
	<where clause="(status = (SELECT CASE WHEN '${inactive}' = 'true' THEN 'inactive' END) OR status = (SELECT CASE WHEN '${done}' = 'true' THEN 'done' END))"/>
</combination>
<combination>
	<where clause="(status = (SELECT CASE WHEN '${active}' = 'true' THEN 'active' END) OR status = (SELECT CASE WHEN '${inactive}' = 'true' THEN 'inactive' END) OR status = (SELECT CASE WHEN '${done}' = 'true' THEN 'done' END))"/>
</combination>