struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre Métras <gen...@sympatico.ca>
Subject Re: Support for ComboBox
Date Sat, 21 Oct 2000 15:04:25 GMT
Hi Gigen

> Is there an archive available for this list that can be searched ?
>
http://archive.covalent.net


> I have a requirement wherein I need to populate a ComboBox from a
> Database.Wanted to know if struts has any kind of support available in
> order to achieve the same.

Right from the box, no.
You'll have to write a bean that reads your data from the database and put
it in two arrays (one for values, other for labels) or collections. Then,
you can use the <struts:select> and <struts:options> tags to create the
combobox and populate the option from the arrays.
The main idea of struts is to separate presentation (your combobox) from the
data, so the need for an intermediate bean (the controller) to manage them.

Pierre Métras


Mime
View raw message