• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sturts+Ajax populate combobox based on another combobox

 
Mel Cen
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic