Hi,

I am using the autocomplete for an input within a table records. By filling in the input the autocomplete list shows up correctly. The label is filled in with the Name and the identifier is also correctly assigned. After clicking the desired option from the autocomplete list I would like that the input is only showing the ID of the selected option. At this moment the input shows the label of the selected option. 

I used the onchange event on the input so that I can use the GetIdentifier of the autocomplete and fill the input with the ID. Until this point it works. Except that I have to refresh the input to really show the ID on the screen. And from there it is just an endless loop. 

Is there a solution for this? 

Hi Marco, 

Thanks for your reply. I've searched through the internet and came across that information as well. But unfortunately it does not say anything about the Identifier. Well, it says that you can use the Input_AutoComplete_GetIdentifier and that is working fine. But I would like to see the identifier instead of the label in my input. And therefor I need to refresh my input which will cause a not optimal working autocomplete. 

Martijn de Pijper,

Would a possible solution be to use an auxiliar list records, where you build "identifier + label" in the expression you want the user to see?

Hope it helps, cheers!

Hi Marco,

Thanks again for your reply. This is not really the problem actually. The label of the list is fine. It is more that when the user clicks one of the options from the dropdown autocomplete list, that the whole label is imported into the input. The wish is just to put the Identifier in the input. This could be done by using the Input_AutoComplete_GetIdentifier and fill the input with the identifier. To do this, a refresh should be considered on the input to get the identifier visible for the user. And there it messes up the whole function of the autocomplete and will disfunction the whole autocomplete functionality. 

Hopefully I explained it a bit better. 

Martijn de Pijper,

I understand better your context. Is your input saving the search in a local variable and your save action using a different variable for the selected list item id?

Maybe for us to help you more, could you share a portion of your code (a new eSpace only with that code).

Regards!

Hi Marco,

Enclosed you can find the OML file of a sample I made. Some remarks;

- This is just an input on the screen. The original situation is that the input is located within a table. Effect is the same.
- After selecting an option, the Onchange of the input will change the Label into the Identifier.
- From this point the input and autocomplete won't function anymore. 

I hope there is a solution for it. 

Thanks again for your input!


Solution

Hi Martijn de Pijper,

Thanks for your details. The solution is to refresh not only the input but also the autocomplete widget. 

Cheers!

Instructions:

  1. Name a div around the input and widget autocomplete.
  2. On input change action, point the refresh widget to that div.


Solution

Thanks a lot Marco!

It is simple as that! *Face palm*

You are welcome Martjin, good luck!