struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garner, Shawn" <>
Subject RE: Struts dropdown boxes
Date Wed, 02 Nov 2005 18:52:02 GMT
I recommend the AJAX solution if you can use JavaSript.

I recommend NOT submitting the page every time you select a value from the
dropdown box.  
1) This is an interruption in experience and is interpreted as a slow
website because it isn't immediate to the user and they are not even sure
why it is submitting.
2) You will be dramatically increasing the bandwidth you use.  Multiply the
number of options in your dropdown box by the number of fields on the page
by the number of users you're expecting.  The server has to do extra
transfers of the form data to and from the user.

I recommend that you make an additional JSP page and put the second dropdown
box on it.  That way the first page will submit.  You can populate the list
of values and display the second page with the second dropdown.  The second
page should NOT have the first dropdown box on it.

Shawn D. Garner

-----Original Message-----
From: Frank W. Zammetti [] 
Sent: Wednesday, November 02, 2005 8:47 AM
To: Struts Users Mailing List
Cc: Struts Users Mailing List
Subject: Re: Struts dropdown boxes

Hi Neil,

If your app can tolerate Javascript (i.e., require it), then Ajax is
probably your best bet.  Take a look here:

Grab a copy of the JWPCookbook.  In it is a recipe called Dynamic
Double-Select, which is exactly what you want.  You should be able to take
that example as-is and use it in your own app without much trouble.

If your are Javascript-averse though, your only real choice is a two-step
approach, i.e., show the page with the first dropdown and a button which
submits the form.  Then display the page with the second dropdown and two
buttons, one to continue on and one to go back and select another option
from the first.

Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
AIM: fzammetti
Yahoo: fzammetti

On Wed, November 2, 2005 8:25 am, Neil Meyer said:
> Hi,
> I need to have 2 dropdown boxes on my jsp page. The first dropdowns
> selected
> value will determine what is pulled from the database for the second
> dropdown.
> I know there is a few ways of doing it but would like to know what most of
> the people recommend doing this.
> Your help is really appreciated.
> Regards
> Neil Meyer
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message