]
Subject: Html:Options usage
Hi, I have a bean class that returns an ArrayList of ArrayLists for my
dropdowns. I am really confused on how to show this dropdowns. Here's my
bean class:
public class UserAccessBean implements java.io.Serializable {
List deptList = new ArrayList();
List brokerList
=javascript:showimage()
option value=pix\\Diane.jpeg selected/option
html:options collection=users property=userId
labelProperty=userId/
/html:select
img src= name=pictures
Thanks
-
To unsubscribe
Is there a way of obtaining a select element where one of the option
sub-elements has the SELECTED attribute ?
Thanks
Renato Romano
Sistemi e Telematica S.p.A.
Calata Grazie - Vial Al Molo Giano
16127 - GENOVA
e-mail: [EMAIL PROTECTED]
Tel.: 010 2712603
if you use html:select with html:option or html:options, the
option that equals the formbean property value will be automaticaly
selected.
(formbean initialized with name=foo)
html:select property=name
html:option value=foofoo/html:option
html:option value=barbar/html:option
Hi,
If I use DyanActionForm, how should I populate dropdown box using
html:options tag? we would declare all the form attributes in
struts-config.xml, how should I initialize the collection and where?
Thanks,
Anand
html:select deals with populating a form property (a String - typically -
for single-select, and array for multi-select); html:options needs a
collection placed into some scope which is commonly done in the Action class
that forwards to the JSP which needs to display the drop-down box.
--
Voytek
, 2003 10:20 AM
Subject: RE: DyanActionForm and html:select, html:options tags
html:select deals with populating a form property (a String - typically -
for single-select, and array for multi-select); html:options needs a
collection placed into some scope which is commonly done in the Action
If we use ActionForm, then we will be having getter for collection which we
can use in our jsp, here is the code
html:select name=userForm property=testStatus
html:options collection=list property=name labelProperty=value /
/html:select
But how can we get the same functionality if we use
Hi
I want to skip the for loop and want to use c:forEach with the html:select.
I tried but failed to set the value to options in select.
Please help me to solve out the problem
Regards
Shashi
Software Engineer
NBSL
shashi == shashi [EMAIL PROTECTED] writes:
shashi Hi
shashi I want to skip the for loop and want to use c:forEach with the
html:select.
shashi I tried but failed to set the value to options in select.
shashi Please help me to solve out the problem
Try spelling out exactly
]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 18, 2003 11:36 AM
Subject: Re: Use of html:options and jstl
shashi == shashi [EMAIL PROTECTED] writes:
shashi Hi
shashi I want to skip the for loop and want to use c:forEach with
the html:select.
shashi I tried but failed to set
html:select name=spgQueuesForm property=queuesName size=1
html:options property=queuesName/
/html:select
/td
All I want to do is have the first option selected, and it is defaulting to the last
option.
any help?
TIA,
Jason
Hi !
Look my sample:
### Form
private ArrayList projektfilterliste;
private String[] projektfilter;
### JSP
html:select property=projektfilter size=1 onchange=newProjektfilter()
styleClass=input_area
html:options collection=projektfilterliste property=value
labelProperty=label
I am not exactly following the logic here. Could you elaborate a little more?
Thanks,
Jason
---Original Message---
From: Slobodan Kasterovic [EMAIL PROTECTED]
Sent: 02/12/03 08:24 AM
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: AW: html:options selected attribute
Hi
: html:options selected attribute
I am not exactly following the logic here. Could you elaborate a little more?
Thanks,
Jason
---Original Message---
From: Slobodan Kasterovic [EMAIL PROTECTED]
Sent: 02/12/03 08:24 AM
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: AW: html:options
[] selected){ this.selected = selected; }
...
### JSP
...
html:select property=selected size=1
html:options collection=all property=value labelProperty=label /
/html:select
...
### Action
...
import org.apache.struts.util.LabelValueBean;
...
ArrayList allContent = new ArrayList();
allContent.add
PROTECTED]
Subject: RE: html:options selected attribute
Take your pick of
http://marc.theaimsgroup.com/?l=struts-userm=103416927522003w=2
http://marc.theaimsgroup.com/?l=struts-userm=103313043614360w=2
http://marc.theaimsgroup.com/?l=struts-userm=103254783510467w=2
http://marc.theaimsgroup.com/?l
I am using DynaValidatorForm, I need help in using html:select
,html:options
property for html:select is defined in struts-config.xml in a form-bean
property
Help appreciated
Thanks
Vinay
type=java.lang.String/
form-property name=pmarital type=java.lang.String/
form-property name=first type=java.lang.String/
/form-bean
I want to get rid of all html:option with one html:options
Thanks in advance ,
Help appreciated
Vinay
- Original Message -
From
=collectionSelect size=1
html:options collection=options property=value
labelProperty=label/
/html:select
There are more examples given in
struts-exercise-taglib
if u install the war file, which u get along with
struts download
--- Vinay [EMAIL PROTECTED] wrote:
Can anyone help me with a sample code
and html:options
Check if you have month day properties defined in your form bean.
Suresh
-Original Message-
From: Scott Seong [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 24, 2003 11:32 AM
To: Struts Users Mailing List
Subject: Need help with html:select and html:options
Hello
Hello,
I'm having trouble with html:select and html:options. Basically, I have
three select/options pairs in a JSP page, and the result is complaining
about No getter method available for Property month for bean name under
org.apache Here is the code sample:
%
Vector states = new Vector
Check if you have month day properties defined in your form bean.
Suresh
-Original Message-
From: Scott Seong [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 24, 2003 11:32 AM
To: Struts Users Mailing List
Subject: Need help with html:select and html:options
Hello,
I'm having
I populate an html:option tag with a collection. I use the html:option
to create a new user in my system and to edit a user in my system.
html:select name=editUserForm property=accessType
html:options collection=accessTypeList property=value
labelProperty=label/
/html:select
When doing
html:options collection=accessTypeList property=value
labelProperty=label/
/html:select
When doing an edit I want the html:option to be shown with the current
accessType of the user I'm editing.
Example. the options are Read-only, Admin, and Analyst that's
the order of the collection, when
On Monday, January 6, 2003, 2:14:38 PM, Gus wrote:
GD html:select name=editUserForm property=accessType
GDhtml:options collection=accessTypeList property=value
GD labelProperty=label/
GD /html:select
GD Example. the options are Read-only, Admin, and Analyst that's the
GD order
Thanks it work!.
-Gus D.
Rick Reumann wrote:
On Monday, January 6, 2003, 2:14:38 PM, Gus wrote:
GD html:select name=editUserForm property=accessType
GDhtml:options collection=accessTypeList property=value
GD labelProperty=label/
GD /html:select
GD Example. the options are Read-only
hi everyone, i have a page whit the following code:
nested:select property=sector
nested:options property=sectorCompany/
/nested:select
where sectorCompany is an ArrayList that i built prior to view the jsp. My problem is:
what i really need is to pass to the result action the value which
You can use the LabelValueBean class for that, see www.husted.com for
examples.
Ilya
-Original Message-
From: Jose Luis
To: Struts Users Mailing List
Sent: 1/3/03 11:04 AM
Subject: html:select and html:options
hi everyone, i have a page whit the following code:
nested:select property
PM
Subject: RE: html:select and html:options
You can use the LabelValueBean class for that, see www.husted.com for examples.
Ilya
-Original Message-
From: Jose Luis
To: Struts Users Mailing List
Sent: 1/3/03 11:04 AM
Subject: html:select and html:options
hi
I apologize for this basic question, but I'm new to struts and Java web
programming in general, and I really can't get the html:options tag to
work...
The error I'm getting, specifically, is:
javax.servlet.jsp.JspException: No getter method available for property
email for bean under
Try using the 'collection' attribute instead of 'name' ... otherwise, the tag
interprets the name/property combination as identifying the collection.
html:options collection=users property=email labelProperty=email/
\-Original Message-
From: Michael P [mailto:[EMAIL PROTECTED]]
Sent
Correct me if I'm wrong, but aren't the quote; entries unnecessary?
Couldn't you just remove them?
-Original Message-
From: Nathalie Foures [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 9:52 AM
To: [EMAIL PROTECTED]
Subject: html:options encoded property
Hi!
I wrote a JSP
Hi!
I wrote a JSP page with the following lines :
...
html:select property=selectedProxies size=10 multiple=true
html:options collection=proxies property=url
labelProperty=name/
/html:select
...
where name and url are the String attributes of a bean named Proxy. This
code displays a box
for the comparison. So if
you are using the 'labelProperty' attribute in html:options/ and the
property you have chosen does not match the output of toString() for a given
object, this will not work. Instead, you need to create a Collection or
ArrayList of Strings that get passed in through the 'property
Hi all,
Quick question that the online docs aren't helping me answer:
I have a snippet:
bean:define id=foo name=FooForm property=foo
type=java.util.Collection/
html:form action=/doFoo.do
html:select size=5 property=foofield
html:options collection=foo labelProperty
=/doFoo.do
Brian html:select size=5 property=foofield
Brian html:options collection=foo labelProperty=labelAttr
Brian property=valueAttr/
Brian /html:select
Brian /html:form
Brian I can fill the html:select with the contents of the foo collection just
Hello
I want to display an aggregated label in a combo box but don't know if it's
possible in struts. Here's the example:
Currently I have -
html:select property=ID size=12
html:options collection=userVector property=userID
labelProperty=lastName/
/html:select
which works fine. But I
: displaying an aggregated label for html:options
Hello
I want to display an aggregated label in a combo box but don't know if it's
possible in struts. Here's the example:
Currently I have -
html:select property=ID
=myActionForm
scope=request
input=MyPage.jsp
forward name=success path=/blah blah
blah/NewPage.jsp/forward
/action
html:form method=post action=/blah blah blah/MySearch
html:select property=customerId
html:options collection=customerNameList property=id
not using the Form (I
doubt this could work)
Here's my solution:
html:form action=getAlaskaGroups.do method=POST
html:select property=plantSelection size=1
html:option value=%bean:message
key=index.selectbox.all//html:option
html:options name=plantListBean property
a blank
drop down list.
in the action :
request.setAttribute(MyActionForm, myForm);
request.setAttribute(customerNameList, myForm.getCustomerNameList());
in page:
html:form method=post action=/blah blah blah/MyAction
html:select property=customerId
html:options collection=customerNameList
Hash Tables don't guarantee order when you pull them out enmasse.
probably best bet is to store it in a list and sort accordingly
(Collections.sort).
Dennis Muhlestein wrote:
I have a hashtable with key/value that get displayed by an html:options
tag.
Works ok, but they are ordered
Dennis Muhlestein wrote:
I have a hashtable with key/value that get displayed by an html:options
tag.
Works ok, but they are ordered in reverse order of the id. That isn't
any performance problem, but it looks a little strange to the user.
For instance, what if you wanted the options
Thanks for the comments. Seems to make more sense not to have
any ordering functionality in the html:options tag anyway.
On Wed, 2002-10-30 at 10:40, Dennis Muhlestein wrote:
I have a hashtable with key/value that get displayed by an html:options
tag.
Works ok, but they are ordered
On Mon, 2002-10-28 at 09:31, Alok Garg wrote:
Hello,
I am facing a problem using html:options tag.
The case:
1) I have a Hashtable map which contain an Id (java.lang.Integer) as the Key and
Description (String) as the value.
2) I have to iterate this Hashtable and display the values
Hello,
I am facing a problem using html:options tag.
The case:
1) I have a Hashtable map which contain an Id (java.lang.Integer) as the Key and
Description (String) as the value.
2) I have to iterate this Hashtable and display the values in a select box.
Please guide me with the above problem
Here is my select population code:
td class=formItem
logic:present name=countries
html:select property=companyCountry size=1 value=US
html:options collection=countries property=code
labelProperty=country /
/html:select
/logic:present
logic:notPresent name=countries
html:select
, 2002 10:48 AM
Subject: Re: Using html:Options tag
Here is my select population code:
td class=formItem
logic:present name=countries
html:select property=companyCountry size=1 value=US
html:options collection=countries property=code
labelProperty=country /
/html:select
html:Options tag
Hello Derek,
Thanks for the reply, I tried using the code sinnpet that u have send, but
I
am getting the following error::
javax.servlet.jsp.JspException: Cannot create iterator for 1=Beauty
at
org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:448
Hello!
I'm trying to use html:options/ but the only thing I get get into the list
are Object.toString() values witch is not very useful for the user.
What I like to do is the equal to
option value=%= myObj.getId() %%= myObj.getName() %/option
Can this be done?
Thanks in advance
Roland Carlsson
html:select property=carrier %-- The form's property to be
populated --%
html:options collection=carriers property=id labelProperty
=name/
/html:select
carriers is a list of Carrier objects in my Session Context
..ng() values witch is not very us..
A witch!
burn her!
burn her!
-Original Message-
From: Roland Carlsson [mailto:roland.c;swetravel.se]
Sent: Thursday, October 24, 2002 19:05
To: Struts Users Mailing List
Subject: html:options /
Hello!
I'm trying to use html:options/ but the only
;swetravel.se]
Sent: Thursday, October 24, 2002 19:05
Hello!
I'm trying to use html:options/ but the only thing I get get into the list
are Object.toString() values witch is not very useful for the user.
--
To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands
Can't carriers be a collection that I can get from the ActionForm?
Regards
Roland Carlsson
- Original Message -
From: [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 1:11 PM
Subject: Re: html:options /
html:select property=carrier
a newt?
-Original Message-
From: Galbreath, Mark [mailto:Galbreath;tessco.com]
Sent: Thursday, October 24, 2002 19:33
To: 'Struts Users Mailing List'
Subject: [OT] html:options /
She turned me into a newt!
-Original Message-
From: Andrew Hill [mailto:andrew.david.hill
Yes you can.
for e.g.
bean:define id=carriers name=CarrierForm property=carrierVector/
- Original Message -
From: Roland Carlsson [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 5:04 PM
Subject: Re: html:options /
Can't carriers
24, 2002 19:05
Hello!
I'm trying to use html:options/ but the only thing I get get into the list
are Object.toString() values witch is not very useful for the user.
--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user
Burn her anyway!
-Original Message-
From: Galbreath, Mark [mailto:Galbreath;tessco.com]
Sent: Thursday, October 24, 2002 19:46
To: 'Struts Users Mailing List'
Subject: RE: [OT] html:options /
I got betta
-Original Message-
From: Andrew Hill [mailto:andrew.david.hill
: Thursday, October 24, 2002 19:05
Hello!
I'm trying to use html:options/ but the only thing I get get into the list
are Object.toString() values witch is not very useful for the user.
--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail
is she made of wood?
Burn her! Burn her!
Rúben
- Original Message -
From: Galbreath, Mark [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 12:49 PM
Subject: RE: [OT] html:options /
Now, how can we tell if she's really a witch
-
From: Roland Carlsson [mailto:roland.c;swetravel.se]
Sent: Thursday, October 24, 2002 19:05
Hello!
I'm trying to use html:options/ but the only thing I get get into the
list
are Object.toString() values witch is not very useful for the user.
--
To unsubscribe, e-mail:
mailto:struts-user
We could try building a bridge out of her!
-Original Message-
From: Galbreath, Mark [mailto:Galbreath;tessco.com]
Sent: Thursday, October 24, 2002 19:58
To: 'Struts Users Mailing List'
Subject: RE: [OT] html:options /
Now, how can we be certain she's made of wood?
-Original Message
Does wood sink in the water?
Rúben
- Original Message -
From: Galbreath, Mark [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 12:58 PM
Subject: RE: [OT] html:options /
Now, how can we be certain she's made of wood?
-Original
AH Ha, can't we make bridges out of stones too?
Rúben
- Original Message -
From: Galbreath, Mark [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 12:58 PM
Subject: RE: [OT] html:options /
Now, how can we be certain she's made of wood
!
burn her!
burn her!
-Original Message-
From: Roland Carlsson [mailto:roland.c;swetravel.se]
Sent: Thursday, October 24, 2002 19:05
Hello!
I'm trying to use html:options/ but the only thing I get get into the
list
are Object.toString() values witch is not very useful for the user
We burn witches so witches must be made of wood. So if shes made of wood
then shes a witch!
-Original Message-
From: Galbreath, Mark [mailto:Galbreath;tessco.com]
Sent: Thursday, October 24, 2002 19:50
To: 'Struts Users Mailing List'
Subject: RE: [OT] html:options /
Now, how can we tell
But, what else floats in the water?
King Arthur's turn
Rúben
- Original Message -
From: Andrew Hill [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 12:54 PM
Subject: RE: [OT] html:options /
We burn witches so witches must be made
for the fun and the help
Regards
Roland
- Original Message -
From: deepak [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 1:51 PM
Subject: Re: html:options /
Yes you can.
for e.g.
bean:define id=carriers name=CarrierForm property
It floats!
-Original Message-
From: Galbreath, Mark [mailto:Galbreath;tessco.com]
Sent: Thursday, October 24, 2002 20:10
To: 'Struts Users Mailing List'
Subject: RE: [OT] html:options /
Now, now...what is the distinguishing property of wood?
-Original Message-
From: Andrew Hill
A duck!
-Ursprungligt meddelande-
Från: ruben
Till: Struts Users Mailing List; [EMAIL PROTECTED]
Skickat: 2002-10-24 14:10
Ämne: Re: [OT] html:options /
But, what else floats in the water?
King Arthur's turn
Rúben
- Original Message -
From: Andrew Hill [EMAIL PROTECTED
]
But, what else floats in the water?
King Arthur's turn
Rúben
- Original Message -
From: Andrew Hill [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 12:54 PM
Subject: RE: [OT] html:options /
We burn witches so witches must be made of wood
ummmvery small rocks?
robert
-Original Message-
From: ruben [mailto:ruben.carvalho;inesc.pt]
Sent: Thursday, October 24, 2002 8:11 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: [OT] html:options /
But, what else floats in the water?
King Arthur's turn
If the weigh is the same,
SHE'S A WITCH
By the way, did you dress her up like this?
Rúben
- Original Message -
From: Galbreath, Mark [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 1:19 PM
Subject: RE: [OT] html:options /
So if we
Well, maybe just the noseand the hat. BUT SHE'S STILL A WITCH!
-Original Message-
From: ruben [mailto:ruben.carvalho;inesc.pt]
Sent: Thursday, October 24, 2002 8:25 AM
To: Struts Users Mailing List
Subject: Re: [OT] html:options /
If the weigh is the same,
SHE'S A WITCH
And she has got a wart!
-Original Message-
From: Galbreath, Mark [mailto:Galbreath;tessco.com]
Sent: Thursday, October 24, 2002 20:30
To: 'Struts Users Mailing List'
Subject: RE: [OT] html:options /
Well, maybe just the noseand the hat. BUT SHE'S STILL A WITCH!
-Original
She's not a newt or wood. She is a parrot and she's pinin' for the fjords..
:)
B
- Original Message -
From: Robert Taylor [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, October 24, 2002 8:18 AM
Subject: RE: [OT] html:options /
ummmvery small
she turned me into a newt!
-Original Message-
From: Andrew Hill [mailto:andrew.david.hill;gridnode.com]
Sent: Thursday, October 24, 2002 8:32 AM
To: Struts Users Mailing List
Subject: RE: [OT] html:options /
And she has got a wart!
-Original Message-
From: Galbreath
Speaking of attention to detail ;-)
-Original Message-
From: John Menke [mailto:john;eagleinfosystems.com]
Sent: Thursday, October 24, 2002 8:42 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: [OT] html:options /
she turned me into a newt!
-Original Message
PROTECTED]
Sent: Thursday, October 24, 2002 12:54 PM
Subject: RE: [OT] html:options /
We burn witches so witches must be made of wood. So if shes made of
wood
then shes a witch!
-Original Message-
From: Galbreath, Mark [mailto:Galbreath;tessco.com]
Sent: Thursday
Who are you who are so wise in the ways of science?
-Original Message-
From: Galbreath, Mark [mailto:Galbreath;tessco.com]
Sent: Thursday, October 24, 2002 8:49 AM
To: 'Struts Users Mailing List'
Subject: RE: [OT] html:options /
And what might be your name, most wise
Is it friday already? Don't tell me I missed another whole day this week!
-Original Message-
From: John Menke [mailto:john;eagleinfosystems.com]
Sent: Thursday, October 24, 2002 8:00 AM
To: Struts Users Mailing List
Subject: RE: [OT] html:options /
Who are you who are so wise
To: 'Struts Users Mailing List'
Subject: RE: [OT] html:options /
Is it friday already? Don't tell me I missed another whole day this week!
-Original Message-
From: John Menke [mailto:john;eagleinfosystems.com]
Sent: Thursday, October 24, 2002 8:00 AM
To: Struts Users Mailing List
Sorry - half an hour to go. :-)
-Original Message-
From: Andrew Hill [mailto:andrew.david.hill;gridnode.com]
Sent: Thursday, 24 October 2002 23:09
To: Struts Users Mailing List
Subject: RE: [OT] html:options /
Almost :-)
Another 3 hours to go for me. But it *feels* like friday
c:set.
-Tim
-Original Message-
From: Roland Carlsson [mailto:roland.c;swetravel.se]
Sent: Thursday, October 24, 2002 8:12 AM
To: Struts Users Mailing List
Subject: Re: html:options /
I found whats wrong... my bean aren't a bean... since a bean have to have a
public no argument constructor
On Thu, 24 Oct 2002, Jerry Jalenak wrote:
Is it friday already? Don't tell me I missed another whole day this week!
Even on a Friday, this thread would have been about 10 messages to long
already ...
Craig
--
To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org
: Thursday, October 24, 2002 5:12 AM
To: Struts Users Mailing List
Subject: Re: html:options /
I found whats wrong... my bean aren't a bean... since a bean have to have
a
public no argument constructor and my is a Singleton... so I'll guess that
I
have to live with a little ugliness
-Original Message-
From: Chen, Gin [mailto:Gin_Chen;tvratings.com]
Sent: Thursday, October 24, 2002 7:46 AM
I'm not sure but I wonder if u can fool struts into doing this
with the new Struts-EL.
I wonder if u do something like assuming that ur singleton is
class Blah
and it
!
burn her!
-Original Message-
From: Roland Carlsson [mailto:roland.c;swetravel.se]
Sent: Thursday, October 24, 2002 19:05
Hello!
I'm trying to use html:options/ but the only thing I get get into the list
are Object.toString() values witch is not very useful for the user
i didnt have my coffee today.. i was copying and pasting names and must have
put it in the wrong place. :-P
sorry.
-Tim
-Original Message-
From: Karr, David [mailto:david.karr;attws.com]
Sent: Thursday, October 24, 2002 11:14 AM
To: 'Struts Users Mailing List'
Subject: RE: html:options
David
(B
(BI think your "bean:define" element needs to reference the bean created in
(Byour loop. Try the following:
(B
(Bbean:define id="telephones" name="ad" property="phones" scope="request"/
(B
(BThank you for your suggestion. Actually I've thught the same thing and have
(Btried that,
I have a problem in accessing a collection (String array) that is in a form
(Bbean when is use html:options tag. Say, I have AddressForm, which has
(B"name" (String) and "address" (String) as members. After my action servlet
(Bputs an array of the AddressForm in a request
e name="ad" property="address"/
(B /td
(B td
(B !-- Phone dropdown --
(B bean:define id="telephones" property="phones" scope="request"/
(B html:select property="phonelist"
(B html:options collection="telephones" property=&qu
The first technique couples your presentation with your business logic more closely
than does the latter. So, my preference would be using the html:options.
You can maintain the collection that makes up the options in the form bean for the
page. Initialization must be handled via
value=fName By Date /html:option
/html:select
Is there any disadvantages to use above approach compared with using
html:options...? If I use html:options ... instead of using above
individual html:option...,as following:
html:select property=choice size=1
html:options collection
Mailing List [EMAIL PROTECTED]
Sent: Thursday, September 19, 2002 9:43 AM
Subject: Re: RGH! SOMEONE! How do I set the default selection when I'm
using html:options?
Yeah, actually this might be your best approach. Mine would depend on
Struts. This approach would be totally independent
very easy way, by getting it from the application bean on
the form, like this :
html:select property=state
logic:present name=abean scope=application
html:option key=text.choosestate value=/
html:options name=abean property
set the default selection when
I'm using html:options?
One more advice to make your life easier: Why bother getting the states
from the database for every form ( or even the same form ) when it's
accessed ? I think the better way is to load the states when the app
starts up and store
]]
Sent: Thursday, September 19, 2002 8:00 AM
To: Struts Users Mailing List
Subject: Re: RGH! SOMEONE! How do I set the default selection when
I'm using html:options?
One more advice to make your life easier: Why bother getting the states
from the database for every form ( or even the same form
Michael,
I'm currently building some functionality on top of Struts for a
project. The way I found to do this the easiest was to keep my config
in an XML file and use the commons digester in a Plugin. Plugin writing
is very straight-forward, and there are a couple of standard examples
101 - 200 of 372 matches
Mail list logo