You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "R.Vijayaraghavan" <rv...@cdacnoida.in> on 2006/01/20 08:31:08 UTC

fill combo box based onClick of previous combo box

Hello,

I have an application where I have 3-4 combo boxes. After selecting a
particular value from the first combo box, the second combo box should be
filled with values from the database. Likewise for other combo boxes. How
can this be implemented in Struts.

Will this be feasible:

Call form.submit on combo box's onClick, then get the value in Action, go to
the Model, get the corrosponding values, fill the form bean in Action class
and open the same page.

regards,
vijay.



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


Re: fill combo box based onClick of previous combo box

Posted by Raghu Kanchustambham <kr...@gmail.com>.
While you can do it yourself, I strongly recommend take a look at the Struts
Layout tags.
http://struts.application-servers.com/

To be specific, for the dependent combo, check
http://struts.application-servers.com/faqs/field.html#Interdependent_combo_box

It is very easy to get it up and running with out much code. However, I am
not too sure if you could do 4 dependent combo boxes. The code definitely
works for level two. You may want to extend the tag lib in case it doesnt
work beyond two levels of dependency and may be post it back to us too ! ;-)

HTH,
Raghu



On 1/20/06, R.Vijayaraghavan <rv...@cdacnoida.in> wrote:
>
> Hello,
>
> I have an application where I have 3-4 combo boxes. After selecting a
> particular value from the first combo box, the second combo box should be
> filled with values from the database. Likewise for other combo boxes. How
> can this be implemented in Struts.
>
> Will this be feasible:
>
> Call form.submit on combo box's onClick, then get the value in Action, go
> to
> the Model, get the corrosponding values, fill the form bean in Action
> class
> and open the same page.
>
> regards,
> vijay.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>