struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "gnanaseelan" <>
Subject Re: Dynamic updation of a selection box based on other select box
Date Thu, 28 Feb 2002 09:34:34 GMT
Hi Nico

   I had a Doubt like ... In my prob
can i set the values of the 2nd select box without going to the Action and
manipulating the values using the formbean

Is it going to server everytime the value changes in the first Select Box

pls clarify,wot u suggested in the solution 3:


----- Original Message -----
From: "Nicolas De Loof" <>
To: "Struts Users Mailing List" <>
Sent: Tuesday, June 25, 2002 1:44 PM
Subject: Re: Dynamic updation of a selection box based on other select box

> Hi
> I have prob:
> I need to dynamically update the options in the 2nd html:select box based
> the value selected in the first html:select box.
> I have the all possible values of 2nd box in same JSP.
> Can any one help me
> thx in advance
> gnan
> Solution 1:
> use javascript to add/remove values to your 2nd box. This is what you can
> get when your IHM has been developped by web designers as a prototype,
> lot's of javascript to render behaviour and hard coded datas. Some would
> like to reuse this script. I don't like this because it will be difficult
> extract datas from javascript "logic" (IMHO javascript is a presentation
> language that has not to handle/format form datas)
> Solution 2:
> Same as S1, but javascript code uses datas that are defined in a
> code generated by a specialized jsp tag, so that you can say the logic is
> implemented by javascript, but is driven by java code (behaviour can be
> configured or can be initialized by Action from model values)
> For example, I use it for a javascript menu: technical javascript code is
> an included .js file, and menu entries are javascript variables setted by
> tag from user profile. (I think struts-menu looks like this too)
> Solution 3:
> javascript onchange event on 1st box sends a request to redisplay the page
> with updated select list. Associated formBean will have a List attribute
> 2nd select box values. This is what is used on .net framework for
> to link html forms to server objects.
> 3nd solution will generate more network trafic but is easier to develop
> maintain.
> Nico
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message