The SearchFormHandler
property propertyValuesByType
is a HashMap that contains one key/value pair for each property named in advancedSearchPropertyValues
whose type is enumerated, RepositoryItem
, or a collection of RepositoryItem
s. The key is the name of the property and the value is a collection of the possible values. propertyValuesByType
is useful for building forms where search form users can select, for example, the size of an item, where size is an enumerated property with a set of predefined values such as Small, Medium, and Large.
The following example shows how to implement an advanced search:
<%-- Create a select field to choose size and a default option --%> Size: <dsp:select bean="MyAdvancedSearchFormHandler.propertyValuesByType.size"> <%-- Create a default choice --%> <dsp:option value="">Any size</dsp:option> <%-- Now create an option for each defined value for size --%> <dsp:droplet name="ForEach"> <dsp:param name="array" value="MyAdvancedSearchFormHandler.propertyValuesByType.size"/> <dsp:oparam name="output"> <dsp:option param="element"/> <dsp:valueof param="element">Unknown size</dsp:valueof> </dsp:oparam> </dsp:droplet> </dsp:select>