Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

...

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 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: 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
themeEclipse
{
  "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.

Events

Onselect

Initiates a client-side script when a selection is made form 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: Profound UI, Genie