Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fix typo

Auto-complete, also referred to as auto-suggest, is a feature that suggests values in a dropdown list as you type into a textbox. In Profound UI, textbox widgets have a set of auto-complete properties that can either provide a static suggestion list or link to a database for suggestions.

Info

To enable scrolling for the auto-complete choices, you must specify the 'max height' property for the textbox.


Auto-Complete Choices

These properties allow you to provide a static or program provided list of auto-complete choices.

Choices

Specifies the options for a textbox with auto-complete. The options should be comma separated. The first option cannot be empty.
Promptable? YES
Possible Values: Comma separated list of valid choices
Bindable? YES
Product: ProfoundUI Profound UI, Genie

Choice Values

Specifies alternate option values to send to the application for a textbox with auto-complete. The values should be comma separated. The first option cannot be empty.
Promptable? YES
Possible Values: Comma separated list of valid values to be returned to application.
Bindable? YES
Product: ProfoundUI Profound UI, Genie

Database-Driven Auto-Complete

These properties allow you to provide the needed information to retrieve the list of auto-complete choices from a database file.

Choices Database File

Database file to be used for a dynamic database-driven textbox with auto-complete.
Promptable? NO
Possible Values: Any valid database file name. Can be specified with library in 'LIBRARY/FILE' format.
Bindable? YES
Product: ProfoundUI Profound UI, Genie

Choice Options Field

Database field name used to retrieve the options for a textbox with autocomplete. Multiple fields can be specified and should be comma separated.
Promptable? YES
Possible Values: Any valid database field name(s) from the Choices Database File
Bindable? YES
Product: ProfoundUI Profound UI, Genie

Choice Values Field

Database field name used to retrieve the values sent back to the application. If omitted, the choice options field is used. If multiple option fields were specified, the first option field is returned.
Promptable? YES
Possible Values: Any valid database field name from the Choices Database File
Bindable? YES
Product: ProfoundUI Profound UI, Genie

Choices Selection Criteria

Optional expression identifying which records should be retrieved from the choices database file.
Promptable? YES
Possible Values: Any valid selection criteria for the Choices Database File. Selection criteria should be formatted like a SQL "Where" clause.
Bindable? YES
Product: ProfoundUI Profound UI, Genie

Choices Parameter Value

Value used for parameter markers specified in the 'Choices Selection Criteria' property. Parameter markers are specified in 'Choices Selection Criteria' by using a question mark ( ? ). 
Promptable? YES
Possible Values: Any valid value that can be used as a parameter for an SQL "Where" clause. 
Bindable? YES
Product: Profound UI, Genie

Max Choices

Optional maximum number of choices to provide for auto-complete. This property controls the size of the auto-complete dropdown list. If not set it defaults to 10.
Promptable? NO
Possible Values: Any positive integer value
Bindable? YES
Product: ProfoundUI Profound UI, Genie

Contains Match

When set to true, the auto-complete query finds records that contain the search text. When set to false, the auto-complete query finds records that start with the search text. The default is false.
Promptable? DROPDOWN
Possible Values: True, False
Bindable? YES
Product: ProfoundUI Profound UI, Genie

Case Sensitive

When set to true, the auto-complete query does not convert the search text or database search column to upper case before comparing. When false, the database column and search text are converted to upper case before comparing. The default is false.
Promptable? DROPDOWN
Possible Values: True, False
Bindable? YES
Product: Profound UI, Genie

Dynamic Auto-Complete

This method allows auto-complete choices to be retrieved from a web service.

Choices URL

Sets the url to a Web service that returns the choice options and values in JSON format. The service can be provided with Profound Logic's RPGsp or another web development framework. RPGsp provides an easy to use platform for developing Web services using ILE RPG. If a choices url URL is used, the database file, choice options field, choice value field, and max choices properties are ignored. A POST parameter named "query" is automatically submitted to the URL that contains the current contents of the widget that is using this property; this is updated every time a request to the URL is made such as on every keystroke within the widget.
Promptable? YES
Possible Values: A valid web service URL
Bindable? YES
Product: ProfoundUI, Genie Profound UI, Genie

Use Choices URL For Reverse Lookup

Normally, the choices url is called when a user types text into the textbox.  If this property is enabled, it will also be called as a "reverse query" when the screen is loaded.  In this scenario, it will be used to look up the choice text for the field that is bound to the value property. Unlike a standard (forward) lookup, when a reverse lookup is run the "query" parameter is not sent.  Instead, a parameter named "reverse" will be set to 1 to indicate that a reverse lookup is in progress, and a parameter named "value" will provide the value that was bound to the widget.

Promptable? YES
Possible Values: true or false
Bindable? YES, indicator
Product: Profound UI, Genie

A choices url web service should provide its response in this JSON format:

Code Block
languagejs
titleJSON Format To Be Returned By Choices URL Web Service
{
  "success":true,
  "errorId":"-999",
  "errorText":"One-line error message here",
  "errorText2":"Long, paragraphs of detailed error message here.",
  "response": {
    "valueField": "FIELD2",
    "results":[
      {"FIELD1":"XXXXX", "FIELD2":"YYYYY", "FIELD3":"ZZZZZ"},
      {"FIELD1":"AAAAA", "FIELD2":"BBBBB", "FIELD3":"CCCCC"}
    ],
    "colWidths": [
       80,
       70,
       60
    ]
  }
}
  • success = Required. Must be true/false to indicate whether the lookup was successful, or whether there was an error
  • errorId, errorText, errorText2 = Required if success=false. Ignored if success=true. Describes the error that has occurred.
    • errorId = A number or code that identifies the error. Examples: "CPF1234", "-12944"
    • errorText = A one-line human-readable message. Example: "File not found"
    • errorText2 = A longer description/discussion of the message. Example: "The file FOO was not found in your BAR directory. If you were not expecting this, you should contact your system administrator and give code -12944 to let them know about the problem"
  • response = Required when success=true. Ignored when success=false. Contains the successful response.
    • valueField = Optional. Denotes one field name from the "results" listing below that represents the value of a choice (vs the displayed text).
    • results = Required when success=true. List of results to show in the auto-complete choices.
      • The field names are user-defined. The names do not matter to Profound UI, but you will need to know what they are for the "valueField" option as well as the "results template" property.
      • You can have any number of fields in each row of results. If you use the "results template" property, you can format how these fields are used. If "results template" is not specified, all of the fields aside from the valueField will be shown concatenated into the choices results.
    • colWidths = Optional. Array indicating the size of each column in pixels for the choices results. If not specified, 100 will be used for each column.

The following variables are sent to the choices url (as url-encoded form data sent in a POST request):

  • AUTH = Only in Profound UI. Profound UI session id
  • workspace_id = Only in Profound.js Spaces. Represents the workspace id.
  • reverse = Specified only for reverse lookups. Set to 1 for reverse lookup, unset otherwise.
  • value = Specified only for reverse lookups. Set to the value that the choice text is needed for.
  • limit = The maximum number of "results" that are expected.
  • query = Characters typed into box to query for. Not provided for reverse lookups.

Click here for an example of writing a choices url web service in RPG using the Profound UI universal display interface.

Events

Onselect

Initiates a client-side script when a selection is made form from the selection list of an auto-complete textbox or a combo box. In the case of an auto-complete textbox, the selected record is passed to the function as a JSON object that has properties named after the selected fields.
Promptable? YES
Possible Values: Any valid JavaScript code
Bindable? YES
Product: ProfoundUI Profound UI, Genie