Mailing List
Subject: Re: html:options where values have embedded quotes
Anyone?
Doug wrote:
We have some customer-supplied selection options that have double quotes
in their values, and Struts 1.1 isn't seeming to handle this correctly.
Best I can tell from the HTML spec, these should
We have some customer-supplied selection options that have double
quotes in their values, and Struts 1.1 isn't seeming to handle this
correctly.
Best I can tell from the HTML spec, these should be placed on the
page as quot; , which will submit them as %22 , which *should* be
seen on the
Anyone?
Doug wrote:
We have some customer-supplied selection options that have double quotes
in their values, and Struts 1.1 isn't seeming to handle this correctly.
Best I can tell from the HTML spec, these should be placed on the page
as quot; , which will submit them as %22 , which *should*
you can do the following:
html:select name=FormName property=xxx
logic:iterate id=product name=FormName property=ListName
option value=bean:write name=product
property=id/bean:write name=product property=name/
/logic:iterate
/html:select
'property' of the select box should be
ArrayList productList = new ArrayList();
CProduct product = new CProduct();
product.setId(new Integer(1));
product.setName(My Product);
productList.add(product);
request.setAttribute(products,productList.toArray());
...
html:option value=--/html:option
html:options collection=products
Hi Frank
Try using
Request.setAttribute(collectionName,list);
html:select name=formBeanName property=seletedValue
html:options
collection=collectionName
value=id
labelProperty=name
name=comCProduct/
/html:select
I
=id label=name/ /html:select
Regards,
Frank
-Ursprüngliche Nachricht-
Von: Claire Wall [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 2. Februar 2004 13:22
An: Struts Users Mailing List
Betreff: Re: html:options and html:select
you can do the following:
html:select name=FormName property
If your list stores objects which is the type of Struts' LabelValueBean (provides only
getValue() and getLabel() methods), then you can simply as
html:select name=formBeanName property=seletedValue
html:options
collection=collectionName
value=value
So your end user has to select 1 of 1800 options 8 times on one page?
I've never had trouble with options but then again i've never smoked
enough crack to think select menus with 1800 options would be a good
thing.
As a test you could use model 1 jsp or/and jstl to compare.,
c:forEach
I think you should re-think your UI design. Besides being very slow, the
select box will be very annoying and difficult for the end user to use. You
should try and narrow down the users choices before they get to the select
box page so that you only need to show a few dozen options at most.
Normally I have an action that prepares data that initialises the form
with default information. This action will get the information from the
message resources (using the chosen locale), puts them into a
LabelValueBean and put those beans into a List. Then that List is put
into the
name/value pairs from a database are handled nicely
in a list of LabelValueBeans.
I'd pull the code to load that list from the database out
into a model class, or perhaps into a Singleton loaded
by an InitServlet (at startup - if the contents weren't
changing, or were at least application-wide)
Mailing List [EMAIL PROTECTED]
Subject: Re: html:options
Date: Sun, 12 Oct 2003 09:51:17 -0500
name/value pairs from a database are handled nicely
in a list of LabelValueBeans.
I'd pull the code to load that list from the database out
into a model class, or perhaps into a Singleton loaded
: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Sunday, July 13, 2003 9:22 PM
To: 'Struts Users Mailing List'
Subject: RE: html:options list source question
Craig Berry wrote:
The jsp page contains an html:form section linked via action mapping
to
the EditDeForm type.
In it, there is a select
Craig Berry wrote:
The jsp page contains an html:form section linked via action mapping to
the EditDeForm type.
In it, there is a select/options section that looks like this:
html:select property=numFmt
html:options collection=numFmtOptions
property=value
labelProperty=label/
div id=xxx
html:select property=property styleClass=%=myStyle% tabindex=100
html:options collection=collection of possible values property=key
labelProperty=value/
/html:select
U can use html:optionsCollection tag instead of html:options.
This will retain the selected value .
From: lcl [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: html:options can not automatically match value
Date: Thu, 5 Jun 2003 10:57:15
Use JSTL's forEach with begin and end attributes.
c:forEach begin=0 end=50 step=1 var=option
c:out value=${option}/
/c:forEach
-Original Message-
From: Barry Volpe [mailto:[EMAIL PROTECTED]
Sent: Monday, June 09, 2003 5:08 PM
To: Struts Users Mailing List
Subject: html:options
I like the simplicity of the code. Don't have
JSTL installed. I'll have to set it up.
- Original Message -
From: Raible, Matt [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Monday, June 09, 2003 4:21 PM
Subject: RE: html:options for simple 1-50 menu
Maybe you need to specify the name of the form bean before the
property=projclieid
e.g.
html:select name=formbeanname property=projclieid
and maybe the collection name should not be the com.nsk.gs.sales.ClientInfo
but the name you put in the request from the action class before you call
the jsp
Sakis,
Thank you very much. I have done as you mentioned, but the result has not
changed.
I have tried to changed the collection name to
com_nsk_gs_sales_ClientInfo(of course, do it in action form to set a same
named attribute in session), and add a name attribute in html:selection tag
, which
PM
To: Struts Users Mailing List
Subject: RE: html:options
correct me if I am wrong.
This would work if getOptionList() returns an array of String.
In my case array is of Objects and one attribute of that object has to be displayed.
-Original Message-
From: [EMAIL PROTECTED]
[mailto
-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 9:39 PM
To: [EMAIL PROTECTED]
Subject: RE: html:options
There are other optiosn to use it...
I ahve never used it with Arays but i have used it with Collections...
First i use jsp:useBean tag to get the collection from
hey thanksmaybe I'll try to minimize my code.
-Original Message-
From: Abhinav (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 12:15 PM
To: Struts Users Mailing List
Subject: RE: html:options
I was able to do it like that.
bean:define id=blist name=MyForm
thanks for replying but the solution doesn't work, so I changed it a bit:
logic:iterate name=filters id=filters indexId=filterIndex
html:select property='%=filter+filterIndex%'
html:optionsCollection property=filters label=label value=value/
/html:select
/logic:iterate
and I got this
logic:iterate name=filters id=filter indexId=filterIndex
select name='%=filter+filterIndex%'html:optionsCollection
name=filter label=label value=value//select
/logic:iterate
-Original Message-
From: e gg [mailto:[EMAIL PROTECTED]
Sent: 17 March, 2003 15:16
To: [EMAIL PROTECTED]
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
at the same application that ships with Struts (html-select.jsp in
struts-exercise-taglib).
Please do search the archives before posting
Sri
-Original Message-
From: Jason Vinson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 12, 2003 9:25 AM
To: Struts Users Mailing List
Subject: Re
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 did something similar, with optionsCollection (which I like).
Here is my code:
logic:select multiple=true size=10 property=addchosencourseids
logic:optionsCollection property=availablecourselabels
label=availablecourseconcatenated value=availablecourseinstanceid/
/logic:select
for
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 of the
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,
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
' attribute of
html:select/ to get compared against.
Hope this helps someone, feel free to say hi if so :)
-b
-Original Message-
From: David M. Karr [mailto:dmkarr;earthlink.net]
Sent: Saturday, November 09, 2002 2:14 AM
To: [EMAIL PROTECTED]
Subject: Re: html:options: how do I preselect
Brian == Brian Topping [EMAIL PROTECTED] writes:
Brian Hi all,
Brian Quick question that the online docs aren't helping me answer:
Brian I have a snippet:
Brian bean:define id=foo name=FooForm property=foo
Brian type=java.util.Collection/
Brian html:form
I guess you got just the same problem as I had.
1. I guess you misunderstood the way of ActionClass and ActionForm.
First of all, the ActionForm gets filled with the data the user types in
the input fields on your jsp. Then the action gets called.
So I bet putting your List into a Form won't
property=id
labelProperty=name /
/html:select
/html:form
Getting a blank drop down list.
???
-Original Message-
From: Marcus Biel [mailto:Marcus.Biel;bmw.de]
Sent: 31 October 2002 11:59
To: [EMAIL PROTECTED]
Subject: Re: html:options with an ActionForm
I guess you got just the same
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 in
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 in
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 in
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
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
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
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
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
: 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
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
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 the
=myLabelField /
/html:select
peace,
joe
-Original Message-
From: Chris _ [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 7:52 PM
To: [EMAIL PROTECTED]
Subject: RE: html:options collection... question
Thanks Joe,
Just for clarities' sake, how exactly would I go
hi all. I am somewhat new to struts and have a question
regarding the
html:options tag.
hi. :)
If I wanted to specify the collection to come from an array or list
contained in a bean, how would that be accomplished?
can I just import the bean class into the jsp and then use
Thanks Joe,
Just for clarities' sake, how exactly would I go about specifying the
collection in the form bean?
Does anyone know of any code examples that I could look at?
hi all. I am somewhat new to struts and have a question
regarding the
html:options tag.
hi. :)
If I wanted
The sample application that ships with Struts (struts-exercise-taglib) gives you
several options -- pardon the pun! Look at html-select.jsp.
Sri
-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 29, 2002 6:29 PM
To: Struts Users Mailing List
Look at the example application in the subscription.jsp and in the
tour.htm has the explanation on how it works...
there is a really simple way of doing it, that is the only way I
know how to do it...
hope it helps..,..
tiago
At 03:28 PM 8/29/2002
Open the struts-exercise-taglib/html-select.jsp, there are 2 examples to
show you how to use Collection to deal with html:option
Billy Ng
From: Ashish Kulkarni [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject:
PM
To: Struts Users Mailing List
Subject: RE: html:options attributes
I know what you are doing, because I did this one time myself.
When you are loading the arraylist, you need to add a new Object to the list
and not the same old copy.
I've attached two zip files that demonstrate
On Fri, 2002-08-09 at 14:08, Kamholz, Keith (corp-staff) USX wrote:
Hey,
Thanks for the tip. I left yesterday before fixing the problem, but I was
guessing that's what the problem was.
I appreciate the help.
~ Keith
http://www.buffalo.edu/~kkamholz
I've just been to your website - you
, August 09, 2002 3:36 PM
To: Struts Users Mailing List
Subject: RE: html:options attributes
On Fri, 2002-08-09 at 14:08, Kamholz, Keith (corp-staff) USX wrote:
Hey,
Thanks for the tip. I left yesterday before fixing the problem, but I was
guessing that's what the problem was.
I appreciate
: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 08, 2002 3:22 PM
To: 'Struts Users Mailing List'
Subject: RE: html:options attributes
Thanks for the reply, but I don't think that message solves my problem. I
know that the collection attribute of the html:options
PROTECTED]]
Sent: Thursday, August 08, 2002 3:42 PM
To: Struts Users Mailing List
Subject: RE: html:options attributes
Keith,
I never had a problem with using a collection with html:options, can you
print out from your action class all elements of the collection
hardwarelist that you put in session
, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta
-Original Message-
From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 08, 2002 4:27 PM
To: 'Struts Users Mailing List'
Subject: RE: html:options attributes
Thanks for the help
Jerry, collection attribute in html:options accepts a Collection of beans
and not a bean having a collections of beans.
Try passing the html:options vector directly instead of the bean that
contains the vector.
html:select property=selectedOption
html:options
PROTECTED]]
Sent: Tuesday, July 30, 2002 11:14 AM
To: Struts Users Mailing List
Subject: RE: html:options not creating iterator
Jerry, collection attribute in html:options accepts a
Collection of beans
and not a bean having a collections of beans.
Try passing the html:options vector
Rajesh,
Thanks. Finally got the options list to render correctly!
Jerry
-Original Message-
From: Rajesh Kalluri [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 12:20 PM
To: Struts Users Mailing List
Subject: RE: html:options not creating iterator
Jerry sorry about
Try adding type=com.whatever.Engineer
html:select property=id value=name
html:options collection=workAuthForm.engineers
type=com.whatever.Engineer Here
labelProperty=name property=id/
/html:select
HTH
James Mitchell
Software Engineer\Struts Evangelist
Have you looked at the source for OptionTag yet?
The first thing it does is check for a SelectTag in the pageContext.
I believe it is forcing this because it needs to know if it should render it
as selected.
If you need the functionality of Options, but need to write your own select,
I would
PROTECTED]
cc:(bcc: David Hay/Lex/Lexmark)
Subject: RE: html:options must be enclosed within html:select
Have you looked at the source for OptionTag yet?
The first thing it does is check for a SelectTag in the pageContext.
I believe it is forcing this because it needs to know if it should
I've been trying to find documentation on how to use a Map collection in
html:options with the Map key as the label name and the Map value as the
label property.
thanks,
sriram
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]
A Map is not a Collection.
Mark
-Original Message-
From: Sriram Nookala [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 10:48 AM
To: Struts Users Mailing List
Subject: Re: html:options with a Map collection
I've been trying to find documentation on how to use a Map collection
, May 14, 2002 11:11 AM
Subject: RE: html:options with a Map collection
A Map is not a Collection.
Mark
-Original Message-
From: Sriram Nookala [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 10:48 AM
To: Struts Users Mailing List
Subject: Re: html:options with a Map
That's great! But a Map is still not a Collection.
-Original Message-
From: Sriram Nookala [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 11:32 AM
To: Struts Users Mailing List
Subject: Re: html:options with a Map collection
I got this to work using the following
' End, Inc. (608) 935-4526
-Original Message-
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 10:50 AM
To: 'Struts Users Mailing List'
Subject: RE: html:options with a Map collection
That's great! But a Map is still
I should know..I'm still cleaning my wounds!
;)
JM
-Original Message-
From: Chappell, Simon P [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 12:04 PM
To: Struts Users Mailing List
Subject: RE: html:options with a Map collection
Please take the hint! Mark is right
html:select property=type
html:option value=/
html:options collection=serverTypes property=value
labelProperty=label/
/html:select
JM
-Original Message-
From: Jayaraman Dorai [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002
insert line html:option value /html:option
like this:
html:select property=stateCode
html:option value /html:option
html:options collection=states_codes property=name
labelProperty=value/
/html:select
Actually html:option value / should do
-Original Message-
From:
Thanks,
Dean Chen
-Original Message-
From: Leonardo Maciel [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 2:55 PM
To: 'Struts Users Mailing List'
Subject: RE: html:options
insert line html:option value /html:option
like this:
html:select property=stateCode
Thanks, it looks so trivial now.
-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 3:02 PM
To: Struts Users Mailing List
Subject: RE: html:options
html:select property=type
html:option value=/
html:options
If PersonalForm has a
Collection getSecurityOptions();
method then it does look OK.
This shouldn't matter, but you could try a type property with
bean:define
-Ted.
Sunder wrote:
Hi,
I am trying to implement the html:options tag in one of our
applications,
I have a form bean with
quick wild guess..
one of the calls to getMerchandiseCategoryDescriptions() returns null.
try returning it was null if you are about to return a null.
--- Allen Walker [EMAIL PROTECTED] wrote:
I have the following:
[html:select property=merchandiseCategory]
[html:options
The collection attribute needs the bean reference only. The dot notation
is for your property. Because the collection isn't the bean itself
you'll have to use a define tag or something to make a bean reference
directly to your collection, then use that reference in your collection
attribute.
Francois == Francois Duchaussoy [EMAIL PROTECTED] writes:
Francois Hi,
Francois I have an ActionForm with a Collection object inside.
Francois I'd like to use the html:options tag to display that Collection.
Francois Could anyone give me an example on how to do that?
There are two ways but the best way is to set up a simple bean
like LabelValueBean that has two attribute; the option value and the
option description
public class LabelValueBean {
String label, descrip ;
public String getLabel() { ... }
public void setLabel( String newValue
The ActionForm itself is a bean in some scope. The name is whatever
you specified in struts-config.
People tend to send the options collection over seperately from the form
(your #1), since it usually a seperate query and sometimes used in more
than one place. But referring to the ActionForm
Chris,
What sort of errors are you getting?
Below is a reprint of a message I posted a few weeks ago. I believe it
addresses a similar question.
Princeton
Re: html:options not understanding collections from form beans
Hello,
I struggled with the options tag because I did not understand what it meant
by 'collection'. I could not pass a collection along with a request because
I was at my index page. In other words, nothing had been done yet.
I instantiated the bean that had the collection and then used a
In subscription.jsp (webapp struts example), you can see :
...
%
java.util.ArrayList list = new java.util.ArrayList();
list.add(new org.apache.struts.webapp.example.LabelValueBean(IMAP
Protocol, imap));
list.add(new org.apache.struts.webapp.example.LabelValueBean(POP3
Protocol, pop3));
Hi, TGIF from me too :)
I guess you could try using an iterate tag because it seems that the values
you want are just a sequence, which you can expose using the indexId
attribute.
Otherwise you will need to specify both the property and labelProperty
attributes of the options tag, which lets
Can you post some of the code you are working with?
Given a method getDirectoryName() you should be able to pass the same
collection to both the labelName and labelProperty properties.
Though, you may need to expose the collection as a bean (in page scope).
The tags are not written with the
On Tue, 10 Jul 2001, Ted Husted wrote:
Can you post some of the code you are working with?
Given a method getDirectoryName() you should be able to pass the same
collection to both the labelName and labelProperty properties.
Though, you may need to expose the collection as a bean (in page
90 matches
Mail list logo