struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "gnanaseelan" <gnanaseel...@indscape.com>
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:

Thanks
Gnan

----- Original Message -----
From: "Nicolas De Loof" <nicolas.deloof@cgey.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
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
on
> 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,
with
> 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
to
> 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
javascript
> 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
in
> an included .js file, and menu entries are javascript variables setted by
a
> 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
for
> 2nd select box values. This is what is used on .net framework for
"webForms"
> to link html forms to server objects.
>
>
> 3nd solution will generate more network trafic but is easier to develop
and
> maintain.
>
>
> Nico
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message