Products Downloads


French version


 

Object containing an editable text box and offering input assistance by proposing a list of results matching the text entered by the user in real-time.


The object is comprised of two graphical components:

  • an entry field,

  • a list of result values displayed dynamically below the entry field, similar to a combo. The result values are displayed vertically, one below the other.

Real-time input assistance means that the results list if progressively "refined" as the user enters text.


The correspondence between the string entered and the set of result values is defined according to a selection criterion.

By default, three predefined criteria are available:

  • "starts with": the string entered corresponds to the start of all result values in the list.
  • "ends with": the string entered corresponds to the end of all result values in the list.
  • "contains": the string entered is a sub-string of all result values in the list.


The set of result values is defined by a list (ordered set of values): In Adelia terms, the object is associated with a LIST.

The object proposes two modes of association:

  • Combo box mode: Visually, the associated list is a single-column list. This list cannot be directly laid out in Dreamweaver (similar to the COMBO object). In terms of 4GL code, the Autosuggest object provides the properties VALUE, CURRENT_VALUE and LIST. It can be manipulated in the same manner as a COMBO BOX.
  • Table list mode: The object is associated with a TABLE LIST object. Results rendering is linked to the rendering of this object (table with header, cell rendering according to the Adelia object types comprising the list's columns, etc.). Visually, the results list can be displayed in multi-column format. In terms of 4GL code, the Autosuggest object provides only the VALUE property. The LIST property does not exist in this mode, as the object is based on the list of the associated TABLE LIST object. To determine the values associated with the VALUE property, the user must select a "value" column amongst the columns making up the TABLE LIST.


The first mode is intended for rapid layout design with relatively simple data. The second mode, on the other hand, is used to design layouts containing more complex data to display (in guide style).

In both of these modes, the text entered into the entry field corresponds to the value of the Autosuggest object. Selecting an element in the associated list places its value in the entry field and, consequently, modifies the object's value.


Click below for further information about:

In a similar manner to the COMBO BOX object's "explicit value-related text" feature, value-related text / value pairs can be managed in the associated list.

In this case, the results list is calculated by applying the selection criterion to the list element value-related texts.

Moreover, the text entered by the user in the entry field must be a value-related text (not a value). The text entered corresponds to a value-related text present in the associated list, whereas the value of the Autosuggest object is derived from the corresponding value-related text / value pair.


In Combo box mode, enabling value-related text management means that only the "value-related text" is displayed in the list (the "value" datum is hidden from the user).

In Table list mode, value-related text management is enabled by choosing a "value-related text" column from the columns making up the TABLE LIST object (the user decides whether the "value" column should be displayed).


If this management is enabled, then in both modes, the object proposes the TEXT_VALUE property, used to retrieve the text entered by the user.

Moreover, in Combo box mode, the object proposes the CURRENT_TEXT property used to associate a specific value-related text with an element in the list.


Object typing

The Autosuggest object is associated with an Adelia type.

It the object provides value-related text support, then it manages two Adelia types:

  • one type for the value-related text: the user will only be allowed to enter values corresponding to this Adelia type into this entry field (via input control),
  • one type for the returned value: this value's type may differ from the first.


Below are two summary tables of supported Adelia types according to Autosuggest object operating mode.



Types of L4G properties of the Autosuggest object in Combo mode
 


VALUE

CURRENT_VALUE

CURRENT_TEXT

TEXT_VALUE

With value-related text

ALPHA

NUM_BIN_2

NUM_BIN_4

NUM_BIN_8

NUM_E

NUM_P

TIME

DATE

TIMESTAMP

ALPHA

NUM_BIN_2

NUM_BIN_4

NUM_BIN_8

NUM_E

NUM_P

TIME

DATE

TIMESTAMP

ALPHA

ALPHA

Without value-related text

ALPHA

ALPHA

N/A

N/A




Types of L4G properties of the Autosuggest object in Table List mode
 


VALUE
(i. e. "value" column type)

TEXT_VALUE
(i. e. "value-related text" column type)

With value-related text

ALPHA

NUM_BIN_2

NUM_BIN_4

NUM_BIN_8

NUM_E

NUM_P

TIME

DATE

TIMESTAMP

ALPHA

Without value-related text

ALPHA

N/A


Values in extreme cases

When the Autosuggest object supports a value-related text, what value should this object assign to its VALUE property when:

  • the results list is empty,
  • no element is selected in the results list,
  • the entry field is blank,
  • the user entered a value into the entry field before the results list was displayed,


In these various situations, the user can specify a value to use according to the Adelia type of the Autosuggest object's VALUE property:


Adelia type

Value

ALPHA

*LOVAL or *HIVAL or *BLANK or a text string to be defined.

NUM_BIN_2 (or 4 or 8)

*LOVAL or *HIVAL or a numeric with ISO format to be defined.

NUM_E (ou NUM_P)

*LOVAL or *HIVAL or a numeric with ISO format to be defined.

DATE (or TIME or TIMESTAMP)

*LOVAL or *HIVAL or a numeric with ISO format to be defined.


Correlation between the VALUE and TEXT_VALUE properties

If the Autosuggest object supports a value-related text, the values of these two properties are linked:

  • If the user enter a value-related text present in the results list, the object's value is that of the value / value-related text pair,
  • If the user enter a value-related text not present in the results list, the object takes a special value.


When manipulating these two properties within the 4GL, updating one of these properties triggers an update of the other:


4GL instruction

Consequence

ASG_1:TEXT_VALUE = 'text'

Updates the VALUE property with the corresponding results list value, or with the extreme case value.

ASG_1 = '123'

The assignment is authorized only if the value is part of the associated list. In this case, the TEXT_VALUE property is updated.


Results list calculation

The results list is calculated by applying the selection criterion to the LIST object associated with the Autosuggest object. This process is triggered when the user enters text in the entry field.

Calculation may be performed automatically, or manually:

  • automatic: The object calculates the result in a completely transparent manner for the user. The list is scanned in its entirety and if a LIST object element meets the criterion, then it is selected (in the *SELECT sense).
  • manual: The user selects the elements to be included in the results list by populating the associated list. He/she can thus implement his/her own selection criterion. At the end of this process, all elements in the associated LIST object are included in the results list.


The results list is calculated in the Autosuggest object's ONSUGGEST Ajax event processing block.

Automatic mode is the default mode. Manual mode is enabled in code, by setting AUTOMATIC_MODE to *FALSE. If this property is *TRUE, then the 4GL code in the ONSUGGEST block is not run.


Notion of performance

For reasons of performance, the results list is calculated once the user has finished modifying the entered text (i.e. a given lapse of time after the last key press), not each time the user presses a key.

Several actions let you influence the results list display time:

  • Define the minimum number of characters entered beyond which the ONSUGGEST event processing block is triggered (default value = 1).
  • Limit the number of result values to display by defining a maximum number of results list elements to return. By default, all results list elements are displayed.
  • In manual mode, optimize the result value search algorithm by working on a sorted list, if possible.
  • Use cache management in the Autosuggest object: the object can store previous results lists to avoid launching a new query on each request.
  • Enable the "case-sensitive" and "accent-sensitive" features when possible (if the input control linked to the Autosuggest field is "All upper case" or "Numeric" for example).


Using the Autosuggest object with keyboard shortcuts

The following actions are available for manipulating the object with the keyboard:

  • Close the results list with the escape key. Similarly, if the user deletes the contents of the entry field, the results list closes.
  • Change the selected element with the Up / Down or Page Up / Page Down keys (same effects as moving the mouse cursor to the text of an element).
  • Retrieve the selected element to the entry field via the Enter, Tab or right arrow keys (same effect as clicking on the element). The results list closes.
  • Place the cursor in the entry field when in selection mode on an element, via the Home key. The results list remains visible.


The Autosuggest object possesses a certain number of characteristics that define its operation:


Characteristic

Description

Operating

Defines the list association mode. The possible values are as follows:

  •  combo box,

  •  table list.


In Table list mode, the user chooses a TABLE LIST object on the page. The following objects are excluded:

  •  with a pitch (number of elements to display during dynamic pagination),

  •  with a number of lines per element greater than 1,

  •  with no columns whose Adelia type is compatible with those supported by the Autosuggest object.


This feature is defined during Autosuggest object layout design.

Minimum number of characters

Defines the minimum number of characters entered by the user beyond which the object triggers a request for result values.

This feature is defined during Autosuggest object layout design or in code.

Maximum number of results

Defines the maximum number of result values returned. This property prevents excessive numbers of results.

If this number is set to -1, all possible values are returned.

If this number is positive, then a text indicating that there are other values is shown at the bottom of the results list. Clicking this text displays the other results by triggering an ONSUGGEST event. This text can be internationalized. For this, you must define a value for the MORE_ELT_SHORT_TEXT and MORE_ELT_TOOLTIP keys in a file named "AWSTagLibAutosuggestBundle_XX.properties" (see "Accent sensitive" attribute of the Autosuggest object).


  • MORE_ELT_SHORT_TEXT=More...
  • MORE_ELT_TOOLTIP=Click to display more results


This property is only supported in automatic results list calculation mode. In manual mode, the user is responsible for limiting the number of elements present in the results list according to this value. Moreover, he/she must manage the text click, indicating that there are other values via the MORE_ELEMENTS and KEY_LAST_ELEMENT properties.


This feature is defined during Autosuggest object layout design or in code.

Cache management

The purpose of this feature is to enhance the results list display performance. Indeed, this management may be of use in the following cases:

    • Case 1: the object launches a previously completed search query. The results list is already known and there is no need to repeat a server-side search.
    • Case 2: the query to be launched will return a subset of a previously completed query (e.g.: with the "starts with" criterion, if the user types "A", waits for the result, then types "B", then the result for "AB" is contained in the previous result for "A").

Important: Case 2 may trigger a server query if the "Maximum number of results" feature is not equal to -1 and if the search result for "A" is incomplete.


This feature is defined during Autosuggest object layout design or in code.


The Autosuggest object cache has a defined life span. When recreated (upon page load via a non-Ajax event, or when the object is hidden then shown in consecutive Ajax event processing blocks), the cache is emptied.


Highlight first element

Highlights the first element in the results list when displayed.

By default, the highlighted element has predefined background and text colors (values defined by the AWSAutosuggestHighlight CSS class). You can specify a different CSS class.


This feature is defined during Autosuggest object layout design or in code.

Propose input

Displays the first element of the results list in the entry field, selecting the sub-string that remains to be typed.

This feature is only allowed if first element highlighting is enabled.


This feature is defined during Autosuggest object layout design or in code.


Selection criterion

Defines a selection criterion to apply when calculating the results list. The Autosuggest object offers several predefined criteria:

  • "starts with": the string entered corresponds to the start of all result values in the list;
  • "ends with": the string entered corresponds to the end of all result values in the list;
  • "contains": the string entered is a sub-string of all result values in the list.

The choice of criterion influences cache management performance: this latter is less efficient with the "ends with" criterion as it is impossible to drill down the search based on characters entered.

Note: If the user wishes to define his/her own selection criterion, he/she simply configures the object in manual results list calculation mode and implement his/her own search algorithm.


This feature is defined during Autosuggest object layout design or in code.

Case-sensitive

Defines whether the selection criterion is case-sensitive, i.e. upper case characters are distinguished from lower case characters when calculating the results list.


This feature is defined during Autosuggest object layout design or in code.

Accent-sensitive

Defines whether the selection criterion is accent-sensitive, i.e. accented characters are distinguished from non-accented characters when calculating the results list.


This feature is defined during Autosuggest object layout design or in code.


Note on localization: When the object is not accent-sensitive, it converts accented characters to their non-accented equivalents. This equivalence is supported for French (language code: ISO-639 'fr'), Italian (language code: ISO-639 'it'), Spanish (language code: ISO-639 'es'), and German (language code: ISO-639 'de'),

To offer support for another language, you must describe this equivalence in a file named 'AWSTagLibAutosuggestBundle_XX.properties', where XX represents the ISO-639 language code. This file should be placed in the AWSResources sub-directory of the directory containing the Web application. Moreover, it must be encoded in ISO-8859-1 (or Latin-1) format.

Each match between a character and the associated accented characters must be defined as follows (one match per line in the file):

DIACRITIC_CHAR_<INCR>=<CHAR_WHITHOUT_ACCENT>-<CHAR_WITH_ACCENT_1>-<CHAR_WITH_ACCENT_2>-....-<CHAR_WITH_ACCENT_N>

Where:

- <INCR> is a number starting at 1 and incremented for each line,

- <CHAR_WITHOUT_ACCENT> is the non-accented character in lower case,

- <CHAR_WITH_ACCENT_N> are the accented characters in lower case matching <CHAR_WITHOUT_ACCENT>.


DIACRITIC_CAR_1=a-à-â-ä

DIACRITIC_CAR_2=c-ç

DIACRITIC_CAR_3=e-é-è-ê-ë

DIACRITIC_CAR_4=i-î-ï

DIACRITIC_CAR_5=o-ô

DIACRITIC_CAR_6=u-ù-û-ü

DIACRITIC_CAR_7=y-ÿ

 

If a character is not defined in the ISO-8859-1 encoding table, it must be written using its value in the Unicode encoding table as follows:

'\uXXXX'

where XXXX corresponds to the character's hexadecimal value in the Unicode encoding table (e.g.: the € character is converted to '\u20AC').

Visual effect

Defines the results list appearance visual effect. This property is only supported by the Internet Explorer browser.


This feature is defined during Autosuggest object layout design or in code.

Drop shadow

Defines a drop shadow for the results list.


This feature is defined during Autosuggest object layout design or in code.

Forced selection

Forces the user to select an element from the results list. If the user enters a string that does not match any values, the contents of the entry field are deleted when it loses focus.


This feature is defined during Autosuggest object layout design or in code.

Enabled

Defines whether the entry field is active.


This feature is defined during Autosuggest object layout design or in code.

Read only

Defines whether the entry field allows text input.


This feature is defined during Autosuggest object layout design or in code.

Mandatory

Lets you define a required field.

If the form is submitted and no value has been entered, an error is detected.


This feature is defined during Autosuggest object layout design or in code.

Results list CSS class

Defines the CSS class style for the results list. This class is assigned to the results list container (DIV HTML tag).


This feature is defined during Autosuggest object layout design or in code.

Highlight CSS class

Defines the CSS class used to distinguish the selected element in the results list.


This feature is defined during Autosuggest object layout design or in code.

Item CSS class

Defines the CSS style class used to display each element in the results list. This class is only used when the Autosuggest object is in combo box mode.


This feature is defined during Autosuggest object layout design or in code.

Header

Defines a results list header value-related text. This header can either be a text, or an HTML fragment. It is displayed above the first element in the results list.


This feature is defined during Autosuggest object layout design or in code.

Footer

Defines a results list footer value-related text. This footer can either be a text, or an HTML fragment. It is displayed at the bottom of the results list.


This feature is defined during Autosuggest object layout design or in code.

Results list width

Defines the display width for the results list. This value is defined by a value followed by a unit (e.g.: "120px", "200em").


This feature is defined during Autosuggest object layout design or in code.

Results list height

Maximum height for displaying the results list. This height is defined by a value followed by a unit (e.g.: "120px", "200em"). When the actual list height is greater than its maximum height, then a vertical scrollbar is displayed to the right of the list elements.



In addition to its graphical properties, the Autosuggest object used a certain number of predefined CSS styles (in the AWSGUIControls.jsp style sheet located in the AWSResources directory).

AWSAutosuggestDiv

This class is assigned to the general container (DIV tag) containing the results list. The value of the container's ID attribute is divAsg<AUTOSUGGEST_OBJECT_NAME> (e.g.: divAsgASG_1). This class is defined as follows :

.AWSAutosuggestDiv {

   position:absolute;

   visibility:visible;   

   display:none;

   background-color:#FFFFFF;

   z-index:2;

}

This class can be overloaded to add a border.

Example

.AWSAutosuggestDiv {

   border:1px solid black;

}


AWSAutosuggestHeader

This class is assigned to the header label container (DIV tag). The value of the container's ID attribute is divHdAsg<NAME_OBJECT_MENU> (e.g.: divHdAsgASG_1).


This class can be overloaded to set a background color.

Example:

.AWSAutosuggestHeader {

background-color:blue;

}


AWSAutosuggestFooter

This class is assigned to the footer label container (DIV tag). The value of the container's ID attribute is divFtAsg<NAME_OBJECT_MENU> (e.g.: divFtASG_1).


This class can be overloaded to set a background color.

Example:

. AWSAutosuggestFooter {

background-color:red;

}


AWSAutosuggestBody

This class is assigned to the sub-container (DIV tag) containing all results list items. This sub-container is included inside the general container. The value of the container's ID attribute is divBdAsg<NAME_OBJECT_MENU> (e.g.: divBdAsgASG_1).

This class is only used if the Autosuggest object is in combo mode.


This class can be overloaded to set a background color (other than that of the header or footer).

Example:

.AWSAutosuggestBody {

background-color:yellow;

}


AWSAutosuggestShadow

This class is used to define a shadow for the results list container. This class is defined as follows :

.AWSAutosuggestShadow {

   position:absolute;   

   margin:3px;   

   width:100%;

   background-color:#000000;

   -moz-opacity:0.10;

   opacity:.10;

   filter:alpha(opacity=10);

   z-index:1;

}

This class can be overloaded to modify the shadow's graphical characteristics.


AWSAutosuggestHighlight

This class is used to highlight the item to select. This class is defined as follows :

.AWSAutosuggestHighlight {

   background-color:highlight;

   color:highlighttext;

}


AWSAutosuggestMoreElt

This class is assigned to the sub-container (DIV tag) containing the text indicating that there are other undisplayed items in the results list. This class is defined as follows :

.AWSAutosuggestMoreElt {

   text-align:right;

}


AWSAutosuggestSpanMoreElt

This class is assigned to the text (SPAN tag) indicating that there are other undisplayed items in the results list. This class is defined as follows :

.AWSAutosuggestSpanMoreElt {

   cursor:pointer;

}

This class can be overloaded to modify the highlighted item's graphical characteristics.


When there are several Autosuggest objects (on a same page, or in various parts of a single layout), the general classes can be overloaded in order to assign different attribute values to each object.

Depending on the tag to which the tag is assigned, proceed as follows:

For each class whose tag ID attribute value is known, the named class corresponding to the ID value must be used.


Class

Tag ID

Named class

AWSAutosuggestDiv

divAsg<AUTOSUGGEST_OBJECT_NAME>

#divAsg<AUTOSUGGEST_OBJECT_NAME>

AWSAutosuggestHeader

divHdAsg<AUTOSUGGEST_OBJECT_NAME>

#divHdAsg<AUTOSUGGEST_OBJECT_NAME>

AWSAutosuggestFooter

divFtAsg<AUTOSUGGEST_OBJECT_NAME>

#divFtAsg<AUTOSUGGEST_OBJECT_NAME>

AWSAutosuggestBody

divBdAsg<AUTOSUGGEST_OBJECT_NAME>

#divBdAsg<AUTOSUGGEST_OBJECT_NAME>


If the named class overloads an attribute already defined in a general class, this attribute must be characterized with !important.


Example:

.AWSAutosuggestDiv { /* class used by all Autosuggest objects of the page */

   background-color:#0A0B0C;

}

#divAsgASG_2 { /* class used only by Autosuggest object ASG_2 */

   background-color:#334455 !important;

}


For a better understanding of the graphical functions for this object, please refer to the examples provided in the Adelia knowledge base (in the EXAMPLE_WEB application area in the KLBADEL environment).


Click below for more details on:


↑ Top of page