This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jquery /Ajax returning multiple fields from servlet

 
Mike Skit
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am using the "Autocompleter" using Jquery / jsp/servelt.
The question is :
As soon as the user has selected the word from the Autocompleter,
I need to return multiple fields from a Servlet/server to the client.

Jsp1 ->ajax/jquery(selected word) -> servlet1 ->Jsp1(Mutiple fields based on the selected word.)

Actually the returned fields is to populate a table with a few columns that need to be refreshed based on the selection made in the Autocompleter dropdown.


Thanks in advance,
-Mike.
A code example will be really appreciated.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Return a JSON array.
 
Mike Skit
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok.. actually i tried that..
it did correctly return the json array...
I am able to update if there is only one field to be updated..

But, there are 2 questions from this point..
1)How do i update if there are multiple fields to be updated.
2)What if i have to update(sort) the table based on what the user selects in the autocompleter..

Any code example will be great..

Thanks for the quick response..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show us your code. You keep asking for code, but that's not the way things work around here. Post your code and we'll help you get it working. Be sure to use UBB code tags.
 
Uzbek Jon
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Return a JSON array.

Use javascript foreach loop to traverse through your result array.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic