Develop > Presentation layer > Customize WebSphere Commerce Accelerator, Organization Administration Console, or Administration Console > Tools framework > Search dialogs


Search dialog definition

<searchDialog> </searchDialog>

The primary element defining a search dialog. The following attributes are supported:

resourceBundle

Required: Resource bundle to be used throughout the entire Search Dialog. For example, samples.samplesNLS

<criteriaPanel> </criteriaPanel>

Panel to define the criteria fields and its dictionary.

databean

Optional: A fully qualified name of a user criteria data bean to provide data definitions on the criteria panel. For example, com.ibm.commerce.tools.test.SampleSearchCriteriaDataBean.

title

Required: Title that displays on criteria panel. For example, searchTitle.

description

Optional: Description of the Search Dialog's function. For example, searchDesc.

<jsFile/>

External JavaScript file to be included in the Search Dialog. Files defined here are included in the parent frame. Thus, access to these functions require parent. prefixed to function calls to scope them to the parent frame. Multiple instances of this tag are allowed.

src

Required: Location of the JavaScript file. For example, /wcs/javascript/tools/samples/sampleSearchDialog.js.

<jsMessage/>

NL enabled message to be used in JavaScript.

name

Required: JavaScript variable name to hold the message. For example, missingFieldMsg.

resourceKey

Required: The resource key name used to retrieve the message from the resource bundle. For example, missingFieldMsg.

<field></field>

Criteria field to be displayed on the criteria panel.

type

Required: The criteria field type. Supported values are hidden, text, select-one, select-multiple, checkbox, radio, and calendar.

name

Optional: The HTML form input name to represent this criteria field. For example, productNumber.

value

Optional: The HTML form input value for this criteria field. For example, sports0001.

size

Optional: The HTML form input size for this criteria field. This field is valid only when the type specified is text. For example, 50.

maxlength

Optional: The HTML form input maxlength for this criteria field. This field is valid only when the type specified is text. For example, 50.

resourceKey

Optional: The resource key name used to display the field name that describes the criteria field. For example, productNumber

beanMethod

Optional: A Java method name in the databean defined in the <criteriaPanel> element. The Tools Framework invokes this method, and expects it to return a String for the hidden field type, and Hashtable for field types select-one, select-multi and radio. For example, getMessage.

<operatorBox></operatorBox>

A selection box to represent matching operator. Only applies to the <field> element.

name

Required: The HTML form selection box name to represent this operator. For example, productNumberOp.

<operator/>

An operator entry in the operator selection box. Only applies to the <operatorBox> element.

value

Required: The HTML form select option value for this operator. For example, EQ

resourceKey

Required: The resource key name used to display the text for this operator. For example, exactMatch

<checkbox/>

A check box entry field. Only applies to the <field> element if its field type is checkbox.

name

Required: The HTML form check box name for this field. For example, displayNum

value

Required: The HTML form check box value for this field. For example, 20.

resourceKey

Required: The resource key name used to display the text for this check box. For example, numToDisplay.

<yearField/>

4-digit year entry field. Only applies to <field> element if its field type is calendar.

name

Required: The HTML form input name for this year field. For example, startDateYear.

<monthField/>

2-digit month entry field. Only applies to <field> element if its field type is calendar.

name

Required: The HTML form input name for this month field. For example, startDateMonth.

<dayField/>

2-digit day entry field. Only applies to <field> element if its field type is calendar.

name

Required: The HTML form input name for this day field. For example, startDateDay.

<resultPanel/>

Panel to define the search result page.

url

Required:The URL to display the search result page. For example, /webapp/wcs/tools/servlet/NewDynamicListView?ActionXMLFile=samples.sampleSearchResult&cmd=ResultList

target

Optional: The target frame that the URL should be displayed on. By default, it is the dialog's content frame. For example, mcccontent

navigationPanelXML

Optional: A customized XML file for Search Dialog's navigation panel. You can customize buttons and actions according to a dialog's XML file. This attribute will only be effective if the default target frame is not changed. For example, samples.sampleSearchDialogRefine


Example

The following example defines a search dialog.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE searchDialog SYSTEM "../common/SearchDialog.dtd">
<searchDialog resourceBundle="samples.samplesNLS">   
<criteriaPanel databean="com.ibm.commerce.tools.test.SampleSearchCriteriaDataBean"
          description="searchDesc">  
     
<jsFile src="/wcs/javascript/tools/samples/sampleSearchDialog.js"/>  
     
<jsMessage name="invalidCharMsg" resourceKey="invalidCharMsg"/>      
<jsMessage name="missingFieldMsg" resourceKey="missingFieldMsg"/>  
     
<field type="hidden" name="secret" value="password"/>      
<field type="hidden" name="messageFromServer" beanMethod="getMessage"/>  
     
<field type="text" name="productNumber" resourceKey="productNumber" size="50" maxlength="50">         
<operatorBox name="productNumberFilter">            
<operator resourceKey="equals" value="EQ"/>            
<operator resourceKey="greater" value="GT"/>            
<operator resourceKey="less" value="LT"/>         
</operatorBox>      
</field>  
     
<field type="select-multiple" name="manufacturer" resourceKey="manufacturer" 
            beanMethod="getManufacturer"/>  
     
<field type="text" name="shortDesc" resourceKey="shortDesc" size="50">         
<operatorBox name="shortDescOperator">            
<operator resourceKey="exactMatch" value="EQ"/>            
<operator resourceKey="containsPhrase" value="LIKE"/>         
</operatorBox>      
</field>  
     
<field type="select-one" name="store" resourceKey="store" beanMethod="getStore"/>  
     
<field type="radio" name="displayNum" resourceKey="displayNum" beanMethod="getDisplayNum"/>  
     
<field type="checkbox">         
<checkbox name="includeBundle" value="true" resourceKey="includeBundle"/>         
<checkbox name="includePackage" value="true" resourceKey="includePackage"/>      
</field>  
     
<field type="calendar" resourceKey="startDate">         
<yearField name="startDateYear"/>         
<monthField name="startDateMonth"/>         
<dayField name="startDateDay"/>      
</field>  
     
<field type="calendar" resourceKey="endDate">         
<yearField name="endDateYear"/>         
<monthField name="endDateMonth"/>         
<dayField name="endDateDay"/>      
</field>   
</criteriaPanel>   
<resultPanel url="/webapp/wcs/tools/servlet/tools/samples/DumpRequest.jsp"
         target="mcccontent" navigationPanelXMLFile="samples.sampleSearchDialogRefine"/>
</searchDialog> 


Related concepts

Search dialogs

Dialogs


Related tasks

Add a search dialog

Add a dialog

Related reference

Search dialog navigation behavior


+

Search Tips   |   Advanced Search