Customizing the Search Part

This topic continues to describe the process of creating a grid component.

If you checked Grid contains a 'Search' part in Selecting the Grid Component Type.

  1. Display the Search Fields page.

    1. Select one or more fields from the Available Fields list and click to move them to the Fields to Search In list.

    2. Optionally, use the , , and buttons to reorganize the sequence of selected fields.

    3. Optionally, change their Display Settings > Control type values from "Textbox" to another control type. Refer to Setting Grid Component Control Properties for more information about setting control properties.

    4. Optionally, change the Display Settings > Search style value. If this value is 0, then the search part uses the search style defined on the Search > Properties menu. Other values will override the search style for this control (V7).

    5. If you want to provide two inputs for a field that define low and high values for a range search, select "True" in the Display Settings > Range search list *. Optionally, redefine the Display Settings > From label and Display Settings > To label prompts (V7).

  2. Optionally, display the Search > Properties menu ( see below ).

  3. Click to preserve your work.

  4. If you do not need to define Detail View properties, click Browser to see the grid running in your browser.

Note : Alpha Five indexes compatible with Lightning Query Optimization will speed up grid searches.

Search > Properties Menu

Hide Grid Part Options

When you build a new grid component and add a search form, you have several options for the display of these components.

  1. Check the Hide Grid Part Options > Hide Grid when no search active if you would like to hide the grid until a search is performed.

  2. If the grid is hidden, optionally click in the Hide Grid Part Options > Text to display when grid is hidden. This opens the HTML Editor, where you can create the text to display.

Category

 

Options and Description

Hide grid when no search active

V6

This option allows you to hide the grid until the search finds one or more records.

 

tmpl.search.HideGridWhenNoActiveSearch as L

Text to display when grid is hidden

V6

Define the text to display when the grid is hidden.

 

tmpl.search.GridHTMLWhenHidden as C

Search Options

  1. Optionally, select the Search Options > Show title field.

  2. If the prior field is selected, you may change the title text that appears in the Search Options > Title field. This is an HTML text field and may contain HTML formatting.

  3. Optionally, select the Search Options > Enable Show/Hide of Search part field. When selected, the search form is hidden until you click on the search link.

  4. Optionally, change the text of the search form link in the Search Options > Title when hidden field.

  5. Optionally, change the initial state of the search form in the Search Options > Initial state field.

  6. Optionally, change the search button label in the Search Options > Search button label field.

  7. Optionally, specify how the search fields should be laid out in the Search Options > Orientation field.

  8. Specify whether you want a clear search link button in the Search Options > Has 'Clear Search' link field.

  9. Specify the type search to perform in the Search Options > Search style field.

  10. Specify whether you want to search for all grid fields using a single search form field in the Search Options > Show single 'Keyword' search field.

  11. Specify whether you want to allow Query by Form syntax in the Search Options > Allow 'Query by Form' syntax field.

  12. Specify how to process multiple search criteria in the Search Options > Combine search criteria using field.

Category

 

Options and Description

Show title

V6

Enables or disables the title above the Search part.

 

tmpl.search.show_title as L

Title

V6

Defines the title of the Search part and may contain HTML formatting.

 

tmpl.search.title as C

Title when hidden

V6

Sets the text of the link to display when the search form is hidden and may contain HTML formatting.

 

tmpl.search.title_when_hidden as C

Enable Show/Hide of Search Part

V6

Enables or disables the user's ability to click on the Search part's title to hide or show the Search part.

 

tmpl.search.EnableShowHide as L

Initial state

V6

Sets the initial state of the Search part when the page is displayed. The options are:

  • "Open"

  • "Closed"

tmpl.search.InitialState as C

Search button label

V6

Specifies the label for the Search button and may not contain HTML formatting.

 

tmpl.search.search_button_label as C

Orientation

V6

Specifies how the Search controls are laid out. The options are:

  • "Vertical"

  • "Horizontal"

tmpl.search.orientation as C

Has "Clear Search" Link

V6

Specifies whether the Search part has a link to clear the search criteria and requery showing all records.

 

tmpl.search.has_Clear_link as L

"Clear Search" Label

V6

Specifies the text to show on the "Clear Search" link and may contain HTML formatting.

 

tmpl.search.Clear_link_Label as C

Search style

V6

Specifies the type of search to perform. The options are:

  • 1 = Exact Match (but not case sensitive)

  • 2 = Is Contained In

  • 3 = Starts with

  • 4 = Wildcard (using the * and ? characters)

tmpl.search.style as N

Show single "Keyword" search field

V6

Enables or disables a single search control instead of showing individual search controls. If a match is found any of the search fields, the record is returned.

 

tmpl.search.show_single_search_field as L

Allow Query by Form syntax

V6

Enables or disables support for Alpha Five's QBF syntax. For example: CA,MA to search for "CA" and "MA", 123..345 to search for >=123 and <=345, ..12/3/2004 to search for dates <=12/3/2004.

 

tmpl.search.allow_qbf_style as L

Combine search criteria using

V6

Specifies how to process multiple search criteria if a user enters search criteria into multiple controls'. The options are:

  • 1 = AND

  • 2 = OR

tmpl.search.combine_criteria_using as N

Keyword search label

V6

Specifies the label of the Search label and may contain HTML formatting.

 

tmpl.search.keyword_label as C

Sort Options

  1. Optionally, specify whether you want a sorting listbox on the search form in the Sort Options > Include 'Sorting' listbox field.

  2. Optionally, specify the label for the sorting listbox in the Sort Options > Label for 'Sorting' listbox field.

  3. Optionally, define the label for the inline style for the sorting listbox in the Sort Options > Inline style for 'Sorting' label field.

  4. Optionally, specify the option to show in the sort listbox when the user has not selected a value in the Sort Options > 'Sort' listbox default field.

  5. Optionally, specify the options to show in the order listbox in the Sort Options > 'Order' listbox options field.

  6. Optionally, specify the option to show in the order listbox when the user has not selected a value in the Sort Options > 'Order' listbox default field.

Category

 

Options and Description

Include Sorting list box

V6

Specifies whether the Search part includes a list box to allow users to select the sort order for the data.

 

tmpl.search.include_sorting_listbox as L

Label for Sorting list box

V6

Specifies the label that appears to the left of the Sorting list box.

 

tmpl.search.sort.prompt as C

Inline style for Sorting label

V6

Specifies style attributes that are used when a validation error occurs. Click to define the In-line style. Refer to the Style Editor for details.

 

tmpl.search.sort.promptInLineStyle as C

Sort list box default

V6

Specifies the text to show in the Sorting list box when the user has not selected a value.

 

tmpl.search.sort.listbox.fieldname_prompt as C

Order list box options

V6

Specify the text for the choices that appear in the Order list box. The entries are:

  • "Ascending" = ascending order

  • "Descending" = descending order

tmpl.search.sort.listbox.order_choices as C

Order list box default

V6

Specifies the text to show in the Order list box when the user has not selected a value.

 

tmpl.search.sort.listbox.order_prompt as C

Records per Page Listbox Options

  1. Optionally, select the Records per Page Listbox Options > Include 'Records per Page' listbox field. If the prior field is selected, the next four fields are enabled.

  2. Optionally, change the label for the listbox in the Records per Page Listbox Options > Label for 'Records per Page' listbox field.

  3. Optionally, change the inline style of the listbox label in the Records per Page Listbox Options > Inline style for 'Records per Page' listbox label field.

  4. Specify the choices to display in the listbox label in the Records per Page Listbox Options > 'Records per Page' listbox choices field.

  5. Specify the option to show in the listbox when the user has not selected a value in the Records per Page Listbox Options > 'Records per Page' listbox default field.

Category

 

Options and Description

Include Records per Page list box

V6

Specifies whether the Search part includes a list box to allow users to select the number of records per page to display.

 

tmpl.search.include_records_per_page_listbox as L

Label for Records per Page list box

V6

Specifies the label that appears to the left of the Records per Page list box.

 

tmpl.search.records_per_page.prompt as C

Inline style for Records per Page label

V6

Specifies style attributes that are used when a validation error occurs. Click to define the In-line style. Refer to the Style Editor for details.

 

tmpl.search.records_per_page.promptInLineStyle as C

Records per Page list box choices

V6

Specify the choices that appear in the Records per Page list box. Enter a comma delimited list of values. For example: 1,5,10

 

tmpl.search.records_per_page.listbox.choices as C

Records per Page list box default

V6

Specifies the text to show in the Records per Page list box when the user has not selected a value.

 

tmpl.search.records_per_page.listbox.value_prompt as C

Freeform Edit Regions

Optionally, add HTML text above, below, to the left, and to the right of the search form in the Freeform Edit Regions fields.

Category

 

Options and Description

Above grid

V6

Defines HTML that appears above the search form.

 

tmpl.EditRegion.Search.Top = <<%txt%

' code here

%txt%

Below grid

V6

Defines HTML that appears below the search form.

 

tmpl.EditRegion.Search.Bottom = <<%txt%

' code here

%txt%

Left of grid

V6

Defines HTML that appears to the left of the search form.

 

tmpl.EditRegion.Search.Left = <<%txt%

' code here

%txt%

Right of grid

V6

Defines HTML that appears to the right of the search form.

 

tmpl.EditRegion.Search.Right = <<%txt%

' code here

%txt%

A search form that uses a single keyword field to search across five different fields [Picture]

Display Settings

Category

 

Options and Description

Control type

V6

The type of control to use. The options are:

  • CheckBox

  • DropDownBox

  • RadioButton

  • TextArea

  • TextBox

tmpl.SearchField_Info[N].controltype as C

Display format

V6

An expression that formats the data in the field.

Search expression

V7

This field is automatically defined. It defines the SQL equivalent to a "calculated" field returned by a SQL Select statement. Assume the SQL Select statement for a grid is:

select (price * quantity) as extendedtotal, price, quantity from order_items


The list of fields that the user can select from is:

extendedtotal
price
quantity


If the user selects
extendedtotal in the search form, the Search Expression field will contain price * quantity.

If, at runtime if the user does a search and enters:

extendedtotal = 200


then behind the scenes, the Application Server translates this into

(price * quantity) = 200

Range search

V7

When checked, displays two fields in the search form to accept high and low values.

 

tmpl.SearchField_Info[N].RangeSearch as L

From label

V7

The label that appears above the "From" field in a range search.

 

tmpl.SearchField_Info[N].FromLabel as C

To label

V7

The label that appears above the "To" field in a range search.

 

tmpl.SearchField_Info[N].ToLabel as C

A search form that uses two fields to set low and high values for a range search [Picture]

Customization

Category

 

Options and Description

Inline style

V6

Sets style properties for cell borders.

 

tmpl.Search.TableInLineStyle as C

Table tag attributes

V6

Optional arguments to insert into the Search part's <table> tag. These tags are in addition to the existing table tags. as a result, not all tags can be added in this manner.

 

tmpl.search.TableAttributes as C

CheckBox Properties

Category

 

Options and Description

Choices

V6

Click  to define the true and false choices set by the check box. Refer to the Define Choices for details.

Orientation

V6

The orientation of the label. The choices are:

  1. "Horizontal"

  2. "Vertical"

tmpl.SearchField_Info[N].CheckBox.Orientation as C

In – line style

V6

Specifies style attributes that override the settings inherited from the style sheet. Click to define the In-line style. Refer to the Style Editor for details.

 

tmpl.SearchField_Info[N].CheckBox.InLineStyle as C

Not in list rule

V6

Specifies the value to set if the user input does not match a specified choice. The options are:

  • "First Entry" - use the first entry in the list

  • "Null" - set the field to NULL

  • "Do Nothing" - accept the user input

tmpl.SearchField_Info[N].CheckBox.NotInListRule as C

A search field with individual search fields, including a calendar control and check boxes dynamically populated with unique record values [Picture]

Drop Down Box Properties

Category

 

Options and Description

Choices

V6

Defines the choices the appear in the control. Click to define the true and false Choices set by the check box. Refer to the Define Choices for details.

Height

V6

Set the height of the label in lines. The default is 1, which produces a combo box. Values larger than 1 produce a list box.

 

tmpl.SearchField_Info[N].DropdownBox.Size as N

In – line style

V6

Specifies style attributes that override the settings inherited from the style sheet. Click to define the In-line style. Refer to the Style Editor for details.

 

tmpl.SearchField_Info[N].DropdownBox.InLineStyle as C

Multi-select allowed

V6

Defines whether the user can select more than one value. Multiple values are ORed together, so that any single value can be True. The options are:

  • "Single"

  • "Multiple"

tmpl.SearchField_Info[N].DropdownBox.selectStyle as C

Not in list rule

V6

Specifies the value to set if the user input does not match a specified choice. The options are:

  • "First Entry" - use the first entry in the list

  • "Null" - set the field to NULL

  • "Do Nothing" - accept the user input

A search field with a list box populated dynamically with unique record values and a freeform layout that combines the Price and Quantity fields in one cell [Picture]

Radio Button Properties

Category

 

Options and Description

Choices

V6

Click to define the true and false choices set by the check box. Refer to the Define Choices for details.

Orientation

V6

The orientation of the label. The choices are:

  • "Horizontal"

  • "Vertical"

tmpl.SearchField_Info[N].RadioButton.Orientation as C

In – line style

V6

Specifies style attributes that override the settings inherited from the style sheet. Click to define the In-line style. Refer to the Style Editor for details.

 

tmpl.SearchField_Info[N].RadioButton.InLineStyle as C

Maximum choices

V6

Specifies the number of choices to display.

 

tmpl.SearchField_Info[N].RadioButton.maxchoices as N

A search field with radio buttons dynamically populated with unique record values [Picture]

Row Properties

Category

 

Options and Description

Hide row

V6

Specifies whether to display this row. The field may still appear in a freeform layout.

 

tmpl.SearchField_Info[N].Column.Hide as L

Row label

V6

The label to the left of the field.

 

tmpl.SearchField_Info[N].Column.Heading as C

Row label in-line style

V6

Specifies style attributes that override the settings inherited from the style sheet. Click to define the In-line style. Refer to the Style Editor for details.

 

tmpl.SearchField_Info[N].Column.InLineStyle as C

Row label position

V6

The position of the label in relationship to the control. The options are:

  • "Left"

  • "Right"

  • "Above"

  • "Below"

tmpl.SearchField_Info[N].Column.LabelPosition as C

Label prefix

V6

Text to be displayed to the left of the row label.

 

tmpl.SearchField_Info[N].Column.Heading_Left as C

Freeform layout

V6

Specify if this column or row should display just this field, or allow a free-form layout.

 

tmpl.SearchField_Info[N].Column.Type as C

Freeform layout

V6

The HMTL code to execute.

 

tmpl.SearchField_Info[N].Column.Type as C

tmpl.SearchField_Info[N].Column.FreeFormTemplate = <<%html%

' code here

%html%

Cell in-line style

V6

Specifies style attributes that override the settings inherited from the style sheet. Click to define the In-line style. Refer to the Style Editor for details.

 

tmpl.SearchField_Info[N].Column.InLineStyle as C

Bubble Help Text

V8

Optionally, set an initial value for the control to display.

 

tmpl.Variable_Info[N].BubbleHelp as C

Label Bubble Help Text

V8

Optionally, set an initial value for the control to display.

 

tmpl.Variable_Info[N].BubbleHelpLabel as C

Break Type

V8

When the number of layout columns is greater than 1, this property helps position controls by starting a new row before or after them:

  • "None"

  • "Break before"

  • "Break after"

  • "Break before and after"

tmpl.Variable_Info[N].Breaktype as C

Column Span

V8

When the number of layout columns is greater than 1, this property sets the number of columns to group together.

 

tmpl.Variable_Info[N].nCols as N

Security groups

V8

The names of the groups permitted or denied access to this field.

 

tmpl.Variable_Info[N].Column.SecurityGroups as C

A search form with the optional Records per page selection list [Picture]

TextArea Properties

Category

 

Options and Description

Rows

V6

Sets the height of the control by specifying the number of rows.

 

tmpl.SearchField_Info[N]. TextArea.Rows as N

Columns

V6

Set the width of the control by specifying the number of columns.

 

tmpl.SearchField_Info[N]. TextArea.Cols as N

In – line style

V6

Specifies style attributes that override the settings inherited from the style sheet. Click to define the In-line style. Refer to the Style Editor for details.

 

tmpl.SearchField_Info[N]. TextArea.InLineStyle as C

A search form with the optional Sort Direction selection list [Picture]

TextBox Properties

Category

 

Options and Description

Size

V6

Sets the width of the field in characters.

 

tmpl.SearchField_Info[N]. Textbox.Size as N

MaxLength

V6

Sets the maximum length of the user's input in characters.

 

tmpl.SearchField_Info[N]. Textbox.MaxLength as N

In – line style

V6

Specifies style attributes that override the settings inherited from the style sheet. Click to define the In-line style. Refer to the Style Editor for details.

 

tmpl.SearchField_Info[N]. Textbox.InLineStyle as C

Style control if error

V6

Specifies whether to apply a second style to the field if a validation error occurs (V6 only).

Control In – line error style

V6

Specifies style attributes that are used when a validation error occurs. Click to define the In-line style. Refer to the Style Editor for details (V6 only).

 

tmpl.SearchField_Info[N].Column.InLineStyle as C

See Next

Customizing the Detail View

Supported By

Alpha Five Version 6 and Above

Limitations

Web publishing applications only.