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
5 matches
Mail list logo