Solved

Dynamic drop-down menu in Struts

Posted on 2004-08-23
6
815 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now