LinkedIn
Copied!

Table of Contents

autoComplete JavaServer Page tag

Use the autoComplete tag to present a drop-down list of candidate text values that a user can select from for an input text box. The text values can be produced by an activity or can be on a clipboard page.

At run time, the Autocomplete icon indicates that the field is supported by an autocomplete tag.

  • Unlike a Local List (defined as a Table Type on the General tab of the Property form), the list presented at run time by an autocomplete tag is not static and can vary from time to time or from user to user.
  • Unlike the Dynamic Select control, the list presented at run time need not be obtained from a Code-Pega-List structure (typically produced by querying the PegaRULES database or another database).

The standard control AutoComplete incorporates an autoComplete JSP tag, and allows you to set most attributes of the autoComplete and acDataSource JSP tags as parameters. Enter an autoComplete JSP tag into hand-crafted HTML code only in special situations where the standard control does not meet your needs.

Example

This JSP tag begins operation after the user types two input characters. It presents a drop-down list for a text box that is 50 characters wide, highlighting the characters that match user input typed in each list element. The data is retrieved by the acDataSource JSP tag.

<pega:autoComplete
	name="AC"
	highlight="true"
	size="50"
	minChars="2">
		<pega:acDataSource name="ACDS" type="ClipboardPage"
		sourceName="ACDatasource" clientCache="false"
		searchPropertyName="Employee" displayField="EmpName"
		partialSearch="true" ignoreCase="true"
		maxResults="true" allFields="true" />
</pega:autoComplete>

Complete syntax

In the syntax presentations below:

  • Square bracket characters [ and ] define optional parts of the tag. Do not type the brackets.
  • JSP tag delimiters <pega and / > mark the start and end of the tag.
  • Replace any text in italics with your choice of value of that type.
<pega:autoComplete name="name"
	[highlight="true|false" ]
	[size = "nn" ]
	[sendingTimeout = "nn" ]
	[delimiter = "zzz"]
	[minChars ="nn" ]
	[listingWidth = "nn"]
	[value = "value"] >
<pega:acDataSource .... />
</pega:autocomplete>

The name attribute is required.

Attribute Value
name Name of this autocomplete control. You can use the keywords $THIS-NAME or $SAVE (saved variable name) as the value of this attribute.
delimiter Optional. Character or characters to use as a separator, for optional fields. If omitted, three hyphens "---" are the delimiter.
highlight Optional. "true" if the text that matches user input is to be highlighted, "false" otherwise. Defaults to "false" if omitted.
sendingTimeout Optional. An integer specifying the number of milliseconds delay before the drop-down list appears. If omitted, the default is 10 milliseconds.
size Optional. An integer specifying the width in characters of the input text box. Defaults to "50" if omitted.
typingTimeout Optional. An integer specifying the number of milliseconds delay after the user types the minimum number of characters before the autocomplete processing starts. Defaults to 10 milliseconds if omitted.
listingWidth Optional. Width of the <div > element in pixels. If omitted, zero.
minChars Optional. Number of characters the user must type or paste into the field before autocomplete processing starts. If omitted, the default is 1 character.
value Optional. Initial value that appears in the text box. You can use the keywords $THIS-VALUE, $SAVE (saved variable name) or reference a parameter with param.name syntax in this field.

JavaServer Pages tags

Related Content

Article

Stream processing of JSP tags
Suggest Edit
Did you find this content helpful?

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.