On 26 June 2015 at 08:43, Ganesh Ranganathan
<
ganesh.ran...@gmail.com> wrote:
>
> On Fri, Jun 26, 2015 at 7:52 AM, David Ng <
david...@gmail.com> wrote:
>>
>> I saw some dynamic search pick list, I mean the pick list is updated
>> whenever I type one character. DO i have to do it in Javascript ?
>
>
> This can be done with jquery. On the change event of the textbox , make an
> ajax call to a action which takes in the typed text and returns a json array
> of objects to be populated in the list. In the success handler of the ajax
> call, remove all existing elements in the list and add the new ones returned
> by the action.
That way will involve a server request for every character typed,
since that could easily be several seconds and maybe a lot more this
will introduce intolerable delays for the user.
For acceptable performance send the complete list to the browser and
manage the selection in javascript.
Colin