Please look at the html-select.jsp file that is part of the struts-exercise-taglib
application that ships with Struts. It demonstrates different ways of specifying the
options for the html:select. It should answer all your questions.
Sri
-Original Message-
From: Marcus Biel
Yes, 30 minutes before I did -I really forgot this valuable source of
information
What I did was really stupid!
At the beginning, I tried to do all features of my page from scratch,
but as it didn't work, I decided to work step by step.
So I left everything aside, and just tried to get this
and it
bounced.
-- Larry Maturo
[EMAIL PROTECTED]
-Original Message-
From: Jose Casas [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 5:55 PM
To: 'Struts Users Mailing List'
Subject: RE: dynamic select box
I know it has been answered before, but that response was not useful to
me
This has been answered before. Loop up html:options and collections
- Original Message -
From: Jose Casas [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, March 26, 2002 2:26 PM
Subject: dynamic select box
Does anybody have sample code that shows how
: Tuesday, March 26, 2002 4:49 PM
To: Struts Users Mailing List
Subject: Re: dynamic select box
This has been answered before. Loop up html:options and collections
- Original Message -
From: Jose Casas [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent
PROTECTED]
Sent: Tuesday, March 26, 2002 3:55 PM
Subject: RE: dynamic select box
I know it has been answered before, but that response was not useful to
me...i'm new to struts and i need something more in depth.
THanks.
Jose Casas
E-Commerce Applications
(501) 277-3112
[EMAIL PROTECTED
Para: 'Struts Users Mailing List'
Asunto: RE: dynamic select box
I know it has been answered before, but that response was not useful to
me...i'm new to struts and i need something more in depth.
THanks.
Jose Casas
E-Commerce Applications
(501) 277-3112
[EMAIL PROTECTED
This is how we do it:
html:select name=yourActionForm property=fieldToHoldSelectedValue
html:options collection=yourArrayList property=optionValue
labelProperty=optionLabel/
/html:select
The ArrayList (in yourActionForm bean) should contain a list of Objects
(call it a
From the sample DB app:
in JSP:
html:select property=contactType
html:optionsCollection property=contactTypeOptions/
/html:select
In Options helper:
/**
* Return an unsynchronized collection of options.
*/
public Collection getContactTypeOptions() {
9 matches
Mail list logo