Hi Paul,
Your question seems very similar to my post last week.
I need to set a pre-defined option in html:select using the
value= attribute, I thought the following will work:
For this you can set the attribute in your form class and when you use html:selectin
your jsp, while populating the
i think you are trying to do the following...
html:select name=UserFormBean property=userId
html:options collection=uList property=id labelProperty=name/
/html:select
this is assuming uList is a list of beans with id/name fields and your
form has a userId field.
Au-Yeung, Stella H
Try something like this,
bean:define id=uList name=UserFormBean property=userList/
bean;define id=person name=person.id /
html:select property=person.id value=%=person%
html:options collection=uList name=UserFormBean property=userId
labelproperty=commonName//html:select
The value attribute is
08, 2004 6:45 PM
To: Struts Users Mailing List
Subject: RE: html:select question
Try something like this,
bean:define id=uList name=UserFormBean property=userList/
bean;define id=person name=person.id / html:select
property=person.id value=%=person% html:options collection=uList
name=UserFormBean
:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 6:45 PM
To: Struts Users Mailing List
Subject: RE: html:select question
Try something like this,
bean:define id=uList name=UserFormBean property=userList/
bean;define id=person name=person.id / html:select
property=person.id value=%=person
it in %= %
bean:define id=engineerId name=shopWorkOrder property=engineerId /
then use %=engineerId% in the html:select.
-Original Message-
From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 4:49 PM
To: 'Struts Users Mailing List'
Subject: RE: html:select question
I got
[mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 8:44 PM
To: Struts Users Mailing List
Subject: RE: html:select question
engineerId is an attribute in the dataBean shopWorkOrder. Can't I
reference shopWorkOrder.engineerId inside the %= %?
I guess shopWorkOrder is the attribute name
-Original Message-
From: Paul Stanton [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 6:45 PM
To: Struts Users Mailing List
Subject: Re: html:select question
i think you are trying to do the following...
html:select name=UserFormBean property=userId
html:options collection=uList
property=userId
labelproperty=commonName//html:select
-Original Message-
From: Paul Stanton [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 6:45 PM
To: Struts Users Mailing List
Subject: Re: html:select question
i think you are trying to do the following...
html:select name
=UserFormBean property=userId
labelproperty=commonName//html:select
-Original Message-
From: Paul Stanton [mailto:[EMAIL PROTECTED]
Sent: Monday, March 08, 2004 6:45 PM
To: Struts Users Mailing List
Subject: Re: html:select question
i think you are trying to do the following...
html:select
I see. I'll try that tomorrow and let you know. Thx.
-Original Message-
From: Paul Stanton [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 09, 2004 12:05 AM
To: Struts Users Mailing List
Subject: Re: html:select question
the most simplest solution is often the best
Au-Yeung, Stella H
Figured it out, I needed to add:
session.setAttribute(list, list);
To my ActionBean
Cheers
William
William Miles wrote:
Howdy folks,
I am having some problems and hope somebody can help. Using
struts-example as a starting point, I would like to move the following
decalration out of the
Struts-el is a good solution for this.
html-el:options collection=${formean.sb_l} property=id
labelProperty=value/ /html:select
-Original Message-
From: Andreas Langmann [mailto:andreas.langmann;isb-ag.de]
Sent: Monday, November 11, 2002 4:15 AM
To: 'Struts Users Mailing List'
Struts-el is a good solution for this.
html-el:options collection=${formean.sb_l} property=id
labelProperty=value/ /html:select
Hmm... thats great! Thanks for advice!
Andreas
--
Dipl. Ing. (BA) Andreas Langmann
Software Developer
ISB AG
Karlstr. 52-54
76133
: RE: html:select question
Are you sure it doesn't work? I have had Struts implicitly convert
booleans to String.
If it doesn't work you could always set up a dummy getter:
public String getFoo() {
return + room.CDRRomUseID;
}
and use 'foo' as your property value.
Sri
-Original Message
I haven't actually used the html:select tag, but it looks as though is
expects to retrieve data from a bean.
The name attribute specifies which bean to use (in the pageContext) and the
property attribute specifies which
property of the bean to use.
HTH,
Pete
Kilmer, Erich wrote:
In the
select has all of the text in the html:option. Is there a
bean called singleSelect stuck in the request or session?
TIA,
Erich
-Original Message-
From: Peter Alfors [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 02, 2001 3:16 PM
To: [EMAIL PROTECTED]
Subject: Re: Html:select question
I
It does this because it needs to pull the value as a property from the bean
in order to determine what value to make selected in the list box.
If you don't want this to be pulled from the bean, then just use regular
HTML tags.
Trever
- Original Message -
From: Kilmer, Erich [EMAIL
18 matches
Mail list logo