Previous Topic: <column> ElementNext Topic: <parameter_group> Element


<parameter> Element

The <parameter> element in an XML search definition defines defines an individual parameter for a search. Specifically, it defines an input field that can be used directly or indirectly as a search parameter.

The supported entities are as follows:

<option>

Specifies a required item for parameters of type="list" or type="choice". List and choice parameters generally need at least two options.

Example:

<option value="4">Four</option>
name

Specifies a unique name for the parameter. You can use this attribute to identify the parameter in a script. It does not need to match the argument name in the SP.

Example:

name="idUser"

Note: This attribute is also used to configure context searches. See Context Searches <parameter>.

value

(Optional) Specifies the default value for the parameter in the Search screen.

Example:

value="my value"

See also Context Searches <parameter>.

type

Specifies the type of search parameter. The type must be compatible with the SP. See Parameter Type Mappings.

Example:

type="text"

The following types are supported:

label

A text label, for enhancing the screen display. It provides no input to the search.

icon

A graphic, for enhancing the screen display. It provides no input to the search.

text

A text input box.

numeric

A numeric value.

date

A date value. Dates may be specified as absolute or relative dates. See Single Date.

date_range

A pair of date values indicating a time period. This is an aggregate parameter that includes several fields to simplify the selection of common time periods. Defaults for the date range may be specified using special attributes as absolute or relative dates. See Date Range.

checkbox

A check box.

list

A list of items from which the user may select one or more. You can enable multiple selections using the multiple attribute and specify dynamic retrieval using the spname attribute. The appearance of the list can be modified using the attrs attribute.

choice

Radio buttons.

lookup

A text box with dynamic lookup, for example, to retrieve a list of users matching a name fragment and to allow selection from a popup.

lookupbyid

A text box similar to lookup, but uses an ID for the search rather than a string. As an example, this is used for the user lookup where instead of using the user name in the stored procedure, the user’s id is used which is more precise and more efficient.

real

A real (decimal) number.

systemid

A special parameter type that provides the reviewer’s user ID or machine ID. These parameters are used internally and do not appear in iConsole search screens.

attrs

(Optional) Specifies additional, type-specific attributes which control the behavior of the parameter. The primary use for this attribute is in conjunction with the list parameter type. See also Multi-Select List Parameters, the date parameter type, and the date_range parameter type.

argpos

(Optional) Specifies the order in which the parameter is listed in the arguments passed to the SP (see the CREATE line in the examples). This allows you to change the parameter layout in a search screen independently of the order in which they are passed to the SP.

Note: If no argpos attribute is specified, the parameter is passed to the SP but may be used in the generation of an actual parameter.

label

(Optional) Specifies the text that is shown next to the search parameter in the Customize Search screen.

Example:

label="Audit Status"
units

(Optional) Specifies a text label appended to a numeric parameter in the search screen.

Example:

units="%"
onchange

(Optional) Defines the JavaScript code to be executed if the parameter value is changed. Use this attribute to give dynamic behavior to the search properties page, for example, to alter another parameter based on the setting of this one.

Example:

onchange="UpdateParameters();"
onclick

(Optional) Defines the JavaScript code to be executed if the parameter is clicked. Use this attribute to give dynamic behavior to the Customize Search page, for example, to disable a particular feature of the search if a parameter is selected.

Example:

onclick="DisableFeature();"
onkeypress

(Optional) Defines the JavaScript code to be executed if a key is pressed. Use this attribute to give dynamic behavior to the Search Properties page, for example, to apply input validation rules.

Example:

onkeypress="ValidateInteger();"
constant

(Optional) A Boolean attribute for specifying that the search parameter cannot be seen or modified by the user. This can be useful for making parameters inaccessible in a simple search variant.

Example:

constant="true"
sppackage

(Optional) Specifies the package name for an SP.

Example: 
sppackage="MyPackage"

Note: On an Oracle database this defines the package in which the SP resides. On an SQL Server database it defines a prefix which is added to the spname parameter.

spname

(Optional) Specifies the name of an SP to use to retrieve a dynamic list of items for a list parameter. The SP returns two columns: values and text labels for each item in the list box.

Example:

spname="WgnWCAuditField1List"
cache

(Optional) Applies only to parameters which are based on stored procedures (that is, those that include the spname attribute—see above). Setting this attribute to true, allows the values retrieved from the stored procedure specified in spname to be cached. This speeds up loading of the properties page as the iConsole does not need to retrieve these values from the database each time the page is opened.

Default: false.

By default, the cache expires 5 minutes after it has first been populated. To change this default, you need to add or edit the registry value SearchParamsCachePeriodMinutes (for details, see the Platform Deployment Guide; search for ‘timeouts, for iConsole’).

restricted

(Optional) Applies only to those parameters based on stored procedures. Specifies whether ‘row level security’ (RLS) is switched on or off for the stored procedure used to retrieve the parameter values. If set to true, RLS is switched on, which can cause the retrieval of the parameter values to run more slowly. If set to false, searches will run unrestricted, allowing access to all data values.

Default: true

lookup_function

Defines the function used to show a dialog for selecting values for lookup and lookupbyid parameter types. The list of values is retrieved from the database and may be sorted and filtered to ease selection from a large list of items. This attribute is required for lookup and lookupbyid types.

Example:

lookup_function="MyUserLookupFunction"

For details and example usage, see Lookup Parameters.

multiple

(Optional) Specifies a flag to indicate that more than one item may be selected from a list type parameter.

Example:

multiple="true"

Default: Specifying this attribute sets the visible size of the list to 4 items (see size). There are two variants of list parameter when used with the multiple flag. For details see List Parameters.

size

(Optional) Specifies the maximum number of characters that can be displayed in the input for text, numeric, real, lookup or lookupbyid parameters. For list parameters, it specifies the number of items to be displayed.

Default: 1 for a normal list; or 4 when multiple is selected.

Example:

size="3"
rows

(Optional) Specifies the number of rows to display in a ‘text’, 'lookup' or lookupbyid parameter.

tooltip

(Optional) Specifies the text displayed as a tooltip when the mouse pointer hovers over the parameter.

Example:

tooltip="Specify the audit status of the emails you want to review."
align

(Optional) Specifies the horizontal alignment of the field: left, center, right. For check boxes, the text label is placed to the right if align="left" and vice versa.

valign

(Optional) Specifies the vertical alignment of the field: top, middle, bottom.

col

(Optional) Specifies the column where this parameter should be placed in a grid. By default a parameter will be specified in the next column. If the value of col is less than the current column a new row is started.

Example:

col="1"

Note: This attribute is only supported when requires="12.5" (or later).

colspan

(Optional) Specifies how many columns this parameter spans in the current parameter line.

Example:

colspan="2"
row

(Optional) Specifies the row where this parameter should be placed in a grid.

Example:

row="2"

Note: This attribute is only supported when requires="12.5" (or later).

rowspan

(Optional) Specifies how many rows this parameter spans in the current parameter group.

width

(Optional) Specifies the cell width for the current parameter.

Example:

width="50%" or width="120px"
hidden

(Optional) Specifies whether the parameter should be hidden by default.

Example:

hidden="true"
report

(Optional) If search attribute show_parameters="true" (see Zoom Element), this specifies whether the current parameter is shown in a search report. This attribute defaults to true so report="false" must be specified to disable the display of the parameter in the report.

Example:

report="false"

Default: true

report_label

(Optional) If parameter attribute report="true" (see above), this specifies a text label for the parameter in the report and overrides the default label attribute described earlier in this topic.

Example:

report_label="reviewed emails"
report_value

(Optional) Specifies a value to be displayed on a report rather than the value passed to the stored procedure. This attribute gets populated automatically for list and choice parameter types, with the item value (generally an index number) being passed to the stored procedure and the report_value being set to the item text.

style

(Optional) Specifies a CSS style for this parameter. This is used typically to specify text formatting.

Example:

style="font-weight: bold"
time

(Optional) Specifies the precision required for the time component in date and date_range parameters (see Customizing Time Display in Date Parameters). The following values are possible:

none

no time shown

hour

only hours shown

minute

hours and minutes shown

second

hours, minutes and seconds shown (default)

Example: Use the following to hide the seconds component:

time="minute"
subsection

(Optional) Specifies the name of a subsection to be controlled by this parameter when type="checkbox". This is used to display optional parameters.

Example:

subsection="optionalParameters"