File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to create a set of interdependent drop down lists in struts 2. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to create a set of interdependent drop down lists in struts 2." Watch "How to create a set of interdependent drop down lists in struts 2." New topic
Author

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

kanishk dewan
Greenhorn

Joined: Aug 11, 2011
Posts: 9
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.

Thanks!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create a set of interdependent drop down lists in struts 2.
 
Similar Threads
Problem while implementing cascade select option in Struts2 [City/Locality/Streets]
struts 2: ajax theme problem
problem running dojo.plugin in struts2.1.6
how to hide and show contents with struts2 div tag
how to populate a list in a another select tag using a select tag using struts 2 & DOJO (ajax)