Solved

Dynamic drop-down menu in Struts

Posted on 2004-08-23
6
809 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
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…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

746 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

16 Experts available now in Live!

Get 1:1 Help Now