EditWhat are Search Forms?
A search form is an object that defines a user interface that can be used to search for objects. Each search form definition is bound to a particular class of objects and has its own layout information. The controls on a search form are used to gather the criterion used to perform a search of the database.
Because IssueNet provides the ability to customize the object model of a solution to an unlimited degree, the tools it provides users for searching and finding items needs to be flexible as well. In the IssueNet client the search function is a form that allows users to pick and enter field values which are similar to the items they are searching for. For a search tool to be effective both the field selection and the field layout need to be intuitive and designed for the information the solution manages.
To satisfy this need, IssueNet provides a design that allows you to create and edit search forms in a What You See is What You Get (WYSIWYG) environment. In this environment search forms are designed by dragging search controls onto a form and binding them to the class properties each control should search against. Each search form searches for objects of a particular class. You can create as many search tools as your solution requires – even multiple search tools for a single class.
EditCreating Search Forms
To begin designing a search from, open an existing form or create a new form from the File menu or New Item toolbar. In the General tab select the class that represents the kind of item the search form is for. In the General tab the Description is an optional field for notes about the search form.
Once the class has been selected, the form layout can be designed in the Layout tab. When the layout tab is open there are three basic design tools:
- The Form Toolbox- The Form Tool box lists the controls IssueNet provides for search form design. To add a control to a search form, drag and drop the control from the list onto the region of the search form where you want to locate it.
- The Layout tab- The Layout tab allows you to select a search form element you want to edit, allows you to re-size search form elements, and permits you to position elements on the search form.
- The Form Properties pane- The Form Properties pane allows you to set the properties for the selected search form element in the layout tab.
EditAdding Search Controls
By adding additional controls, the form can be configured to search against any class property. The process of adding a control to a search form has two steps.
The first step is to drag the correct type of control onto the form by selecting the control in the Form Toolbox and dragging it onto the form layout to the desired location. You will want to select the control type based on the type of property you want to bind the control to. For example, if the property is bound to an item list and displayed on the object from using a combo box, a combo box would typically be the best choice for searching that property.
Once a control has been added to the form its properties can be edited in the Form Properties pane. The most important property to set is the Member Name property in Form Properties pane. This property determines which class property the control is bound to. The available class properties are based on the class the form is bound to in the Class Binding field of the General tab. Once a control has been added and bound to the correct property, the form can be loaded by a user in the client and used in searches.
EditThe Text Search Control
Each search from has a built in control at the top for text search capability. This control provides the ability to search across multiple text fields using standard options such as: Exact Match, Contains Any, Contains All. The text search control has two configurable properties - the text fields available in the text search control and whether the search text control is visible.
The fields available for text search can be changed by clicking on the region of the text search control where the check boxes for the text fields are located and editing the Available Properties in the Form Properties pane. Clicking on the ellipses button to edit the property will open a Text Search Editor Box which can be used to select the text fields for the control.
The text search control can be made invisible by selecting the edge of the control and editing the Visibility property in the Form Properties pane. Changing the visibility of the text search control is particularly useful when text search is not required, and the region can be made available for additional controls.
EditSearch Form Best Practices
Each search form control type has number of properties that can be edited to change the behavior and appearance of the search from. However, there are a few control properties that deserve specific notice since they are properties that most organizations will want to configure to make searches easier and enhance form appearance. These properties include:
EditSetting the Empty Item Property
If you are adding a combo box to a search form you always want to allow the user to set a pervious selected value to nothing in order to wider their search criteria. To allow a combo box to be set to nothing, set the IncludeEmptyItem property to true and set any desired text as the empty item label in the EmptyItemName property.
EditSetting the Drop Down Style to Allow User Defined Entries in Combo Boxes
In some instances it is useful to provide a combo box which provides a user with a list of choices but also allows them to enter their own text in the control. Enable a combo box control for this type of use, set the DropDownStyle property of the ComboBox control to DropDown from the default value DropDownList.
EditSetting the Anchor Property for Proper Form Layout
If a control added to a form does not maintain the desired position, particularly when the form is re-sized, try adjusting the Anchor property of the control. This property and the Docking property control how a control resizes itself and moves on the form. There are many different way to set these properties. However, a good guide is to select an existing control on the form and copy those settings.