When you have an existing query that appears in the Search panel of Weave, you can have define search parameters as lists rather than free-form text or check boxes. A list will perform an "exact" search in your database so can make searching easier.
Step-by-step guide
- Identify which Active Layer and field on that layer you want to have appear as a list in your Search panel.
Add a Data Definition to your
data.xml
file. Set the XML Attributes ofname
andlabel
as shown in the example below and set thecolumn
XML Attribute to the column in the table to be read as the values in the list. The XML Attributes ofname
andlabel
only need to be configured if you want to one column to be displayed in the list but a different column to be used in the search.
Add a comment in your XML file to indicate that the following section is used to define Query or Search Lists. This will make it easy to identify all your query list definitions in your XML file.
The example below creates a list of Planning Zone codes.Code Block language xml theme Eclipse <!--Query Lists--> <data:datadefinition id='zonecodes'> <datasourcedataconnection datasource='gis' table='mann.zones' prefix='DISTINCT'> <parameter type='string' name='label' label='Label' column='zone_code' /> <parameter type='string' name='value' label='Value' column='zone_code' /> </datasourcedataconnection> </data:datadefinition>
In your
search.xml
file, identify the section of code that relates to the existing Search you will be modifying.
Add a search parameter definition that will make use of the list defined in Step 23. The key in part of this definition is:
controlType='listbox'
. And ensure that thedataset
parameter is set to the listid
defined above.The example below uses the list of Planning Zone codes created above.
Code Block language xml theme Eclipse <search:parameter id='zonescodelist' label='Zone Code List' controlType='listbox' column='mann.zones.zone_code' dataset='zonecodes' labelcolumn='label' valuecolumn='value'/>
You may need to refresh your browser to see this list in your Search panel.
...
Filter by label (Content by label) | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Page Properties | ||
---|---|---|
| ||
|