Solved

Dynamic drop-down menu in Struts

Posted on 2004-08-23
6
818 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

765 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