You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joel Baker <ne...@news.jb21.net> on 2002/06/18 15:47:30 UTC
Dynamic
Hi there,
I am trying to create a form in Struts that displays to the user a
multi-select form element whose contents (ie: <option> tags) are pulled from
a SQL database over JDBC.
ie:
<html:form action="/search" focus="people">
<select name="people" multiple>
<option>Joel Baker</option>
<option>Fred Flinstone</option>
<option>Foo Bar</option>
</select>
</html:form>
but with the contents of the option tags dynamically created.
I have searched the docs and have come across things like options (
http://jakarta.apache.org/struts/doc-1.0.2/struts-html.html#options ) as
well as mumblings about dynamic properties, but none of these appears to
make any sense.
I suppose I could just write a bean that is included in my JSP file to query
the database in its constructor and then to call some function of this bean
to write out all the <option> tags, but this was precisely how I used to do
this sort of thing in Model 1 JSP. How should this problem be approached in
Model 2?
Many thanks for any help,
Joel Baker.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>