Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
kota
2
Views
5
Comments
Input_AutoComplete_GetIdentifier returning typed value
Question
I have a autocomplete based on the static entity and while trying to save the record, I and checking to see if user have selected a valid value by performing (Input_AutoComplete_GetIdentifier.Identifier = -1 ) check. For some weird reason, it returns whatever is typed in the text field. What am I doing wrong ?
Regards
João Rosado
Staff
Hi Kota,
One of the parameters of that method is the "previous value". What is happening is that you are setting that parameter to the same variable of the input.
The correct way to use it is to either pass as argument the id it had in the preparation of the screen. That way you will be able to distinguish the 3 possible situations: the user did not change the input, the user changed the input to a valid value or the user changed it to an invalid value.
If your input is always empty at the beginning of the screen, then just pass -1 to it.
Regards,
João Rosado
kota
Thanks Joao, That was exactly the issue. I knew there was something wrong with previous value but couldn't figure it out. Actually in this screen the identifier and the label are the same and input was always empty in the beginning of the screen, so that was creating the problem. After setting it to -1 , it is working correctly.
Regards
kota
Joao, I have a related question.
If user select a valid value from an auto-complete and then manually type in some other value that is not in the auto-complete list, and hit save , it retain the value that user selected from the screen and does not return -1 as identifier.
I am using value bound to recordedit as previous value.
What could be causing it ?
kota
I think I have found the problem, if user doesn't tab out of the input box, it doesn't work.
kota
Are we supposed to set the previous value from preparation screen record or from the record edit screen ? I couldn't find any documentation for it. Although that shouldn't matter in most cases IMO.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...