Autocomplete in Csentry

Discussions about CSEntry
Post Reply
htuser
Posts: 437
Joined: December 19th, 2011, 6:26 pm
Location: HAITI

Autocomplete in Csentry

Post by htuser » July 11th, 2014, 11:43 pm

Dear Gregory,
Do you have some good method for implementing autocomplete task in csentry?
Thanks for response!

Gregory Martin
Posts: 1250
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Autocomplete in Csentry

Post by Gregory Martin » July 14th, 2014, 2:59 pm

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;

htuser
Posts: 437
Joined: December 19th, 2011, 6:26 pm
Location: HAITI

Re: Autocomplete in Csentry

Post by htuser » July 15th, 2014, 9:26 pm

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
Attachments
Autocomplete.zip
(5.25 KiB) Downloaded 172 times

Gregory Martin
Posts: 1250
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Autocomplete in Csentry

Post by Gregory Martin » July 16th, 2014, 8:07 am

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.
Attachments
Autocomplete.zip
(3.5 KiB) Downloaded 195 times

htuser
Posts: 437
Joined: December 19th, 2011, 6:26 pm
Location: HAITI

Re: Autocomplete in Csentry

Post by htuser » August 10th, 2014, 10:16 pm

Dear Gregory,
Thanks for all. That's work finely!

Post Reply