Solved

Dynamic drop-down menu in Struts

Posted on 2004-08-23
6
817 Views
Last Modified: 2008-02-01
Dear Experts,

I want to create dynamic-dropdown menu in Struts.

Say, I have Department, Teams and Members.

I need to populate Teams based on the Department selection and Members based on the Teams selection.  At first thought, I was about to post in JavaScript section. But, just want to know if anyone has accomplished similar task in Struts.

<TR>

<TD><bean:message key="FilterList.department"/></TD>
<TD colspan="3" >
<html:select property="department" onchange="deptSelected();" >
<html:option value="Department A"> Department A </html:option>
<html:option value="Department B"> Department B </html:option>
</html:select>
</TD>

</TR>

<TR>

<TD valign="top" ><bean:message key="FilterList.teams"/></TD>
<TD>
<html:select multiple="true" property="teams" onchange="teamSelected();">
</html:select>
</TD>

<TD valign="top" ><bean:message key="FilterList.members"/></TD>
<TD>
<html:select multiple="true" property="members">
</html:select>
</TD>

</TR>

Please share me if you have any suggestions.

Thanks.
0
Comment
Question by:ldbkutty
6 Comments
 
LVL 35

Assisted Solution

by:girionis
girionis earned 50 total points
ID: 11868448
You can do a separate request to the database for each option selected. All you can load everything up at once, put them in a JavaScript array and dynamically change the values. Up to you, it's not really a Struts issue.
0
 
LVL 92

Assisted Solution

by:objects
objects earned 50 total points
ID: 11868477
0
 
LVL 3

Accepted Solution

by:
Gunt earned 400 total points
ID: 11876063
http://providers.sourceforge.net/
It's a framework for handling that kind of things. Supports dynamic combos and the such.

Might help you.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 32

Author Comment

by:ldbkutty
ID: 11876150
that was excellent. :-)
Thanks to all.
0
 
LVL 92

Expert Comment

by:objects
ID: 11876172
0
 
LVL 35

Expert Comment

by:girionis
ID: 11878434
:)
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question