Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

How to create a set of interdependent drop down lists in struts 2.

Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Despite so many topics on this one I have not been able to figure it out for struts 2.

I have 5 drop down lists, and I want that a change in the selection of any one of these, should cause change in the contents of other drop downs without loading the complete page again, i.e asynchronously.

What I am currently trying is (using dojo) :

1.) When the selection of any of drop downs changes, the onChange event publishes a dojo topic.

2.) A topic listener causes an action to be executed.

Up to this point its fine. The action gets executed and sets the lists for the drop downs as expected.

Now what should happen is that :

--> When the action has completely executed it should come back to the same page (set in the struts config file) and update the lists of the drop downs with the new lists set in the action class.

I can not figure out how to do this.

Please help.
Also if there is a better way of doing it please help me out with it, along with the codes please.

Here is the code of what I have done:

The jsp page containing the drop downs.

the struts config file:

The action class just sets the lists for the drop downs. I have checked that it works fine.

Please help asap.

Oh the stink of it! Smell my tiny ad!
Garden Master Course kickstarter
    Bookmark Topic Watch Topic
  • New Topic