File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Field Refresh Using AJAX in Struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Field Refresh Using AJAX in Struts2" Watch "Field Refresh Using AJAX in Struts2" New topic

Field Refresh Using AJAX in Struts2

Abdul Mujeeb Md

Joined: Aug 25, 2008
Posts: 26

How do we populate a text field with the value from database, when a dropdown value is selected.

eg: OnChange of a dropdown an AJAX event is to be triggered and populate the adjacent textfield with the value from the database.

Sean Clark

Joined: Jul 15, 2009
Posts: 377


You chave just given yourself the answer.
You cheate an onchange event that will send an ajax request and then populate some DIV (or an input box in this case) with the response.

Do you have any code to look at or a specific question?


I love this place!
I agree. Here's the link:
subject: Field Refresh Using AJAX in Struts2
It's not a secret anymore!