Page 1 of 1

Autocomplete in Csentry

Posted: July 11th, 2014, 11:43 pm
by htuser
Dear Gregory,
Do you have some good method for implementing autocomplete task in csentry?
Thanks for response!

Re: Autocomplete in Csentry

Posted: July 14th, 2014, 2:59 pm
by Gregory Martin
Right now there is no convenient option for doing this. Perhaps you could use the selcase function to simulate the behavior of an autocomplete field, though that would force the user to type part of the response and press Enter without seeing if the response is valid.
PROC AUTOCOMPLETE_FIELD

    
if selcase(RESPONSES_DICT,strip(AUTOCOMPLETE_FIELD)) then
        AUTOCOMPLETE_FIELD = RESPONSES_FIELD;

    
else
        
// if the response has to be in the response listing, then uncomment the following line:
        // reenter;

    
endif;

Re: Autocomplete in Csentry

Posted: July 15th, 2014, 9:26 pm
by htuser
Dear Gregory,
Thanks for your help. However, when i try to implement the codes, the autocomplete task is not ok...
Please can you help me more?
Thanks in advance

Re: Autocomplete in Csentry

Posted: July 16th, 2014, 8:07 am
by Gregory Martin
You may want to write code more like this:
if selcase(REPONSE_DICT,"") include(REPONSE) where pos(tolower(strip(FRUITS)),tolower(REPONSE)) then
Your external dictionary file could also just consist of the fruit names instead of also having a numeric ID (that you aren't using). In that case, the ID of your external dictionary would be the fruit name.

See attached for your program.

Re: Autocomplete in Csentry

Posted: August 10th, 2014, 10:16 pm
by htuser
Dear Gregory,
Thanks for all. That's work finely!