How to Use a List in an Attribute Search

When you have an existing query in the Search panel of Weave, you can 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

  1. Identify which Active Layer and field on that layer you want to have appear as a list in your Search panel. 
     
  2. Add a Data Definition to your data.xml file. Set the XML Attributes of name and label as shown in the example below and set the column XML Attribute to the column in the table to be read as the values in the list. The XML Attributes of name and label 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. 
     

  3. 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.

    <!--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>
  4. In your search.xml file, identify the section of code that relates to the existing Search you will be modifying. 
     

  5. Add a search parameter definition that will make use of the list defined in Step 3. The key in part of this definition is: controlType='listbox'. And ensure that the dataset parameter is set to the list id defined above. 

    The example below uses the list of Planning Zone codes created above. 

    <search:parameter id='zonescodelist' label='Zone Code List' controlType='listbox' column='mann.zones.zone_code' dataset='zonecodes' labelcolumn='label' valuecolumn='value'/>
  6. You may need to refresh your browser to see this list in your Search panel. 




Also refer to the following sections of the Weave System Administrator Guides: