Page 1 of 2

Auto-complete not functioning correctly

Posted: Wed Jan 04, 2012 1:27 pm
by MLC601
I've got an issue with a textbox with auto complete not working. I'm building choices and choice values lists in the RPG program. These are bound to the Choices and Choice Values properties respectively (comma separated). Here's the issue...if I make the field a textbox with auto-complete, no list appears, however, If I change the field to a dropdown, all of my choices appear...everything works as it should.

Any suggestions?

Thanks,

Mark

Re: Auto-complete not functioning correctly

Posted: Thu Jan 05, 2012 1:01 pm
by Brian
Can you give me an example of your comma separated lists that aren't working? That would help debug the problem. Also, make sure you are not putting the list elements in quotes as that won't work.

Re: Auto-complete not functioning correctly

Posted: Thu Jan 05, 2012 3:21 pm
by MLC601
I'm loading the choices based on the records I've put in a subfile. For each record written to the subfile, I place the name in an array (n_choice).

Variable NameChoice is defined as a 15500A field, bound to the Choices property. I'm building NameChoice with the following code:
z = 1;
Dow z <= Choice;
NameChoice = %trim(NameChoice) + ',' + n_choice(z);
Z=Z+1;
Enddo;

Where Choice is the number of entries. No quotes around the choices.

All of this works fine if I make the field a dropdown.

Thanks,

Mark

Re: Auto-complete not functioning correctly

Posted: Thu Jan 05, 2012 5:46 pm
by Brian
Ok, I'm just not able to recreate the problem. So, what version of PUI are you running?

Can you set your screen as a text box with the autocomplete not functioning and send me the JSON for the screen? You would do this by running your program and then on the screen in question, entering "javascript:pui.downloadJSON()" in the address bar.

Re: Auto-complete not functioning correctly

Posted: Fri Jan 06, 2012 10:12 am
by MLC601
I sent the JSON via PM.

Thanks,

Mark

Re: Auto-complete not functioning correctly

Posted: Fri Jan 06, 2012 10:51 am
by Brian
Ok, which field am I looking for?

Re: Auto-complete not functioning correctly

Posted: Fri Jan 06, 2012 12:04 pm
by MLC601
would be NameChoice.

Mark

Re: Auto-complete not functioning correctly

Posted: Fri Jan 06, 2012 12:20 pm
by Brian
OK, I found your problem. Luckily it is something simple. When your program is outputting the comma separated list of names, it is putting a comma before the first entry. Removing this extra comma made the auto complete function work properly.

Let me know if you need any additional help.

Re: Auto-complete not functioning correctly

Posted: Fri Jan 06, 2012 12:25 pm
by MLC601
Great! I appreciate the quick response!

So I assume to allow a blank entry, I'd need to put blank(s) before the first comma?

Mark

Re: Auto-complete not functioning correctly

Posted: Fri Jan 06, 2012 1:07 pm
by Brian
No need for a blank entry at all. The list for autocomplete is not a validation list. The text box will still accept any entry. so just remove the leading comma and you are set.