Page 1 of 1

autocomplete "_hinput" not updated if typed or copy-pasted

Posted: 19 Jul 2011, 08:16
by moonblade.wolf
primefaces 2.2.1

As far as i know it, an autocomplete has 2 input elements, one with id_input and one with <id>_hinput, where the value <id>_hinput will be used to the converter if we are using POJO.

If i choosed the item from the autocomplete popup list, either by click or up/down arrow keyboard, the <id>_hinput will be updated with the string representation generated by the converter.

But if i type the complete string inside the autocomplete, and if i copy-pasted the whole string inside the autocomplete, the <id>_hinput is not updated with the string representation generated by the converter.

Is there any solution or workaround for this ?

Re: autocomplete "_hinput" not updated if typed or copy-past

Posted: 19 Jul 2011, 08:34
by cagatay.civici
How should autocomplete know the hinput value if you don't select the item from the suggestions.

Re: autocomplete "_hinput" not updated if typed or copy-past

Posted: 19 Jul 2011, 09:28
by moonblade.wolf
Im not sure also, but i wonder whether this approach below will work ?

1) User typed or pasted the content, and as usual, the ajax calls happen to get the suggestions
2) The suggestion returned from the ajax call have 1 exact result and it matches what's in the <id>_input, which i think is the condition to set the converter-string to <id>_hinput

Re: autocomplete "_hinput" not updated if typed or copy-past

Posted: 11 Aug 2011, 09:58
by moonblade.wolf
Hello ..

Do you guys think this make sense ?

I reason if the user can type, and if it matches the converter string, this should be handled as if it's selected from the selection list.
In the eyes of the user, he's just typing or pasting the same thing that appears on the selection list, and gets confused why it wouldnt work when typed or pasted.

Regards,
Albert Kam