• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sturts+Ajax populate combobox based on another combobox

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic