I use the html:options tag :
Just create a Collection (here gender of the Databaseentries (f,m) and
pass as a bean to the page
with the form.
html:select name=yourForm property=gender
html:options collection=gender property=id
labelProperty=description/
/html:select
If you need more
Hello,
I have a JSP in which there are number of dropdown along with text boxes. I am using
struts tag lib for getting the value when I submit the form.
The problem is when I try to populate the dropdown in th JSP with the data that i get
from the databse .
For example I have dropdown for
Hello,
I always use the html:options tag and it works fine; try the following:
(there is a type error in your example)
html:select property =gender
html:option value=mm/html:option
html:option value=ff/html:option
/html:select
ofcourse, in the database you should have the values f or m
: Thursday, September 04, 2003 5:38 AM
To: [EMAIL PROTECTED]
Subject: populating Drop down -pls help
Hello,
I have a JSP in which there are number of dropdown along with text boxes. I
am using struts tag lib for getting the value when I submit the form.
The problem is when I try to populate
]
Subject: populating Drop down -pls help
Hello,
I have a JSP in which there are number of dropdown along with text
boxes. I am using struts tag lib for getting the value when I submit the
form.
The problem is when I try to populate the dropdown in th JSP with the
data that i get from the databse
I use the html:options tag :
Just create a Collection (here gender of the Databaseentries (f,m) and
pass as a bean to the page
with the form.
html:select name=yourForm property=gender
html:options collection=gender property=id
labelProperty=description/
/html:select
If you need more
I am a newbie to struts. This is a simple question and is not totally
specific to Struts but is related to the best way to use struts. I am
trying to find out what is the recommended approach for populate drop-downs,
lists etc?
For example say from a simple Logon page I forward to a Supplier
To: [EMAIL PROTECTED]
Subject: Populating Drop-down
I am a newbie to struts. This is a simple question and is not totally
specific to Struts but is related to the best way to use struts. I am
trying to find out what is the recommended approach for populate drop-downs,
lists etc?
For example
Infrastructure Operations
[EMAIL PROTECTED]
(614) 213-6100
Sinclair, Mark [EMAIL PROTECTED] on 06/10/2003 08:30:00 AM
Please respond to Struts Users Mailing List
[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: Populating Drop-down
I am a newbie to struts. This is a simple
, June 10, 2003 7:44 AM
To: Struts Users Mailing List
Subject: Re: Populating Drop-down
I don't know if it's a best practice or not, but what I do is have the link
to the edit screen actually point to an action, which is responsible for
initializing any related collections and storing them
Message-
From: Poon, Johnny [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 9:56 AM
To: 'Struts Users Mailing List'
Subject: RE: Populating Drop-down
Mark,
I'm glad you asked the question, caz' I was wondering about the same thing.
I'm using label/value. This is what I'm doing.
I'm
the populated
form in the request?
Thanks.
JP
-Original Message-
From: Kandi Potter [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 9:22 AM
To: Struts Users Mailing List
Subject: RE: Populating Drop-down
Hi Johnny,
I'm also using label/value vectors.I don't hard-code the form-name
List'
Subject: RE: Populating Drop-down
Hi Kandi,
Thanks for the post. I'm pretty new to actually using strut, I understand
you mentioned Struts will look for the bean in request scope and use it if
it exists, but I guess I'm not sure if I get where you actually do the
dropdown form population
someone else has replied, but just some more hints.
You can look at html:optionsCollection which as
support for labelValueBeans.
The idea about using using the tiles:controller is an
excellent one, but I have not done this.
You will probably want it in application context and
not load them all
14 matches
Mail list logo