Autocomplete boxes

Autocomplete boxes

  

Afternoon OS and co.

I am currently attempting to create a page with an autocomplete-box-updating list of records, but am coming up short of a solution. I have seen many posts stating that I require a 'wizard' created page and/or empty record placeholder, but none of these solutions work for me...
I just cannot assign or convert a combobox to an autocomplete box.

Can anybody provide a simple guide for me to follow, please?
Solution
Hello Adam,

Here's an example of an autocomplete with a list of users.

First you need a local variable to hold the value that the user writes in the screen. In this example, I'm expecting the user to write a username...



Then you add an input and associated that input with the variable. Don't forget to name your input because it will be necessary in the next step.



Alongside with the input add the richwidgets "Input_AutoComplete" webblock to the screen. This webblock has a number of inputs...



In the first one, "InputWidgetId" you need to add the ID of the input that will have the autocomplete behaviour. This ID is the name of your input followed by ".id".

Then you have the "Destination"; this is the action where you will query for the values you want to show on the drop down below the input field. Just create a new action and rename it for something meaningful.




Now let's move to the action "GetValuesForAutoComplete". In this action you need two local variables. One record and one record list, both with "Record Definition" set to Input_AutoComplete_ListEntry.





First thing to do inside the action is to search for your users. In this example I'm searching for users based on the value that the user wrote on screen



And inside the query I'm using a parameter with the "Is search parameter" set to true...



This query will return a list of users that we want to show on the autocomplete list. To do that, we need to add those to the record list variable that we've created before. I'll iterate through the result of the query, add the id and the name of the user to the Input_AutoComplete_ListEntry var and then add that one to the record list Input_AutoComplete_List

The action at a high level...



inside the assign...



and inside the list append...



The record list now holds the values that you want to show on screen. To show it, just use the Input_AutoComplete_ShowList action from RichWidgets and the list will appear on screen.



With that, you have the screen showing the list that comes from the query



Now, usually you will need to know what's the ID of the selected element in the autocomplete box. There's an action for that in RichWidgets named "Input_AutoComplete_GetIdentifier". You can use it in an action, give it the id of the input just like before and you get the selected identifier.





Hope it helps!
Pedro Cardoso


Solution
... and by the way... here's the example eSpace.
Great job Pedro!
Thanks André!

Many thanks Pedro - thats exactly what i needed.
Autocomplete GetIdentifier is not working.It is returning empty value.
I have given the id of the input

Hi Rajgaurav.
Can you share a screenshot of the configuration of the input an the action associated with it?
Nuno Reis wrote:
Hi Rajgaurav.
Can you share a screenshot of the configuration of the input an the action associated with it?
  Please check the attachment(ItemInput is the input field) Input_AutoComplete_GetIdentifier.GetIdentifier is returning empty.
You can refer my espace
Resource Scheduling in appsDev.outsystem.net
 
How to update Input_AutoComplete_ShowList based on combo box selection changed.
On first time it is picking the category id on which i have to select the items but if i change the category than selected category id is getting changed but based on that autocomp box list is not getting updated.
Hi Rajgaurav.
If the builtin autocomplete isn't working, you may want to try an alternative autocomplete solution.
Check this forge autocomplete component.

Best regards,
Leonardo Fernandes
rajgaurav jaiswal wrote:
How to update Input_AutoComplete_ShowList based on combo box selection changed.
On first time it is picking the category id on which i have to select the items but if i change the category than selected category id is getting changed but based on that autocomp box list is not getting updated.
 Hi Guys,
Thanks all for your reply,I have done this by using the on change event of drop down and calling the Action which is responsible to bind the data in autocomplete based on category Id.
 
rajgaurav jaiswal wrote:
Autocomplete GetIdentifier is not working.It is returning empty value.
I have given the id of the input
 
Hi Guys,
Thanks all for your reply, i solved it by calling the Get Identifier on “On Change” event of Input box which is bound to autocomplete box.
 
Hi
The AutoComplete Input has a placeholder text associated to it - "type or doubleclick for list"
how Do i change it. Updating the prompt doesnt seem to be helping either. 
Any suggestions?? 
With Platform 9 this is even easier.
No need to iterate through records to build the list, or even creating local variables...
Just bind the output of your aggregate - which can be a calculated column - and, when using it in the InputAutoComplete_ShowList action, just map the fields you want to use as Identifier and Label


 in my example the UserWithName is a calculated column at the aggregate with the expression 'User.Name + " (" + User.Username + ")"'
To Gonçalo's point, doing that calculated column is doing something like the following:

1 - Start with your simple agregate


2 -Add a new attribute




3 - Name it and edit the formula



4 - Concat whatever you need from your entity to be used like Gonçalo talks about in the previous post


Now go and have fun agregating your data :)

Cheers
Pedro Cardoso
sue B wrote:
Hi
The AutoComplete Input has a placeholder text associated to it - "type or doubleclick for list"
how Do i change it. Updating the prompt doesnt seem to be helping either. 
Any suggestions?? 
 
 in relation to this .. i want my field to show this ... in some it does however with others it autopopulates it with the some data when i open it in the browser .. which i then have to0 change by double clicking / typing etc
Sat, I'm sorry but I don't get your point.... can you elaborate a little bit more?
its ok.. i have fixed it
Him

Anyone can tell me how can I define the font size and Input_AutoComplete widget size. I enclosed the widget in a container but still it's not working properly.

Thanks!

Best Regards,
Nuno Jesus