wood burning stoves 2.0*
The moose likes Struts and the fly likes Sturts+Ajax populate combobox based on another combobox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Sturts+Ajax populate combobox based on another combobox" Watch "Sturts+Ajax populate combobox based on another combobox" New topic
Author

Sturts+Ajax populate combobox based on another combobox

Mel Cen
Greenhorn

Joined: Apr 23, 2011
Posts: 7
hi guys,

based on this code given by google search,


and my own codes:
combobox1



combobox2



my action class


i found out that the onchange works by making an ajax request but i have no idea how to control the processStateChange function.


this is what i get when i did the onchange.



Uploaded with ImageShack.us

can anyone guide me on how does document.getElementById("componentCombo").innerHTML = req.responseText; works ?

or how can i populate combox2 collection based on selection from combox1 the right way using ajax and sturts.

Thanks in advance.
pooja par
Ranch Hand

Joined: Feb 14, 2011
Posts: 31
document.getElementById("componentCombo").innerHTML = req.responseText;

so now if the response text is array of arrays/list/map etc.. what ever it is, it will be displayed in the componentCombo
The reponse that you get from your action class should be in one of that format(array of arrays/list/map etc..)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sturts+Ajax populate combobox based on another combobox
 
Similar Threads
pass <bean:write> to a function
AJAX Call timout: code: 12002
populate <html:options> with AJAX response
How to change property of form bean from java script using AJAX
Recursive call to a JavaScript method with AJAX call