Autocomplete Widget
The autocomplete widget enables users to quickly find and select an item from a pre-populated list as they type. This list can be constructed based on a RunMyProcess collection or any other datasource. There are two ways to configure an autocomplete widget:
Autocomplete with jQuery
Let's follow an example with a collection named users (with col_users as identifier in web form). We can identify 4 columns in it and their respective properties :
- Name : name
- Id : id
- Entity : entity
- Location: location
Now, we create the web interface that will retrieve the 4 fields and their ids:
- Name : id_user_name
- Id : id_user_id
- Entity : id_user_entity
- Location: id_user_location
We will need also a javascript widget id_autocomplete_script containing the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
We configure then the collection that will be used to populate the autocomplete list:
The autocomplete widget requires jQuery and jQuery-ui libraries, add them from the Javascript tab. Make sure you add the libraries in the correct order.
Finally, save the webinterface and load it to preview the result:
Packaged Autocomplete
When the datasource of the autocomplete widget is a RunMyProcess collection, you can simply use the autocomplete option of the textinput field which packages all the scripts we used above
You can access the selected item data by using the P_selected object. In the On select script add this javascript
1 2 3 |
|
Please give details of the problem