File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Interdependent dropdown lists Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Interdependent dropdown lists" Watch "Interdependent dropdown lists" New topic
Author

Interdependent dropdown lists

Smitha Venkatesh
Greenhorn

Joined: Jan 23, 2008
Posts: 3
Hi...
My form contains 2 dropdown lists(1 for companies and other for its locations)that are dynamically generated based on the number of companies entered by user.I am able to get the first list but the problem is in obtaining the second because values of the location list is based on the output of the first list.

thanks in advance,
Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi Smitha Venkatesh ,

You need to get all these values in a controller class before going to your jsp page, and then you can display these values in as many list as possible.
I mean to say just retrieve all the information which required for your jsp page before going to that jsp page and set their values in your controllers.
Regards,


Khushwinder
Smitha Venkatesh
Greenhorn

Joined: Jan 23, 2008
Posts: 3
Hi Khushwinder,
i am following the same method,getting all the values of locations in a list in business logic class then setting the list as session attribute in action class.Its working great for a single company,but i am facing problem for miltiple companies(the same list is displayed for all the companies).I am not able to display multiple lists in jsp.
thanks,
Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi Smitha

Pleas elaborate your query little bit more.
I think you need to use javascript for that purpose.
Explain you query a bit more.

Regards,
Smitha Venkatesh
Greenhorn

Joined: Jan 23, 2008
Posts: 3
i got it... there was some mistake while looping in jsp..
thanks a lot..
Harshawardhan Deshpande
Greenhorn

Joined: Dec 08, 2011
Posts: 2
Hi Smitha,

Can you post back the solution you got? or the code-snippet you wrote.
It would be of great help.

Thanks
 
Don't get me started about those stupid light bulbs.
 
subject: Interdependent dropdown lists
 
Similar Threads
Dynamically assigning list to Html:select options
Populating child menu based on parent menu in datatable
session object or population methods in ActionForm??
Dynamic dropdown population in portlet
Retrieving different values in seperate dropdown fbox