Hi Frank

Try using

Request.setAttribute("collectionName",list);

<html:select name="formBeanName" property="seletedValue">
        <html:options
                collection="collectionName" 
                value="id"
                labelProperty="name"
                name="com....CProduct"/>
</html:select>

I have tried putting the Collection as the request attribute never in
the form bean. One more thing make user you provide exact path of
CProduct in the name field.

Regards

Anant

-----Original Message-----
From: Otto, Frank [mailto:[EMAIL PROTECTED]
Sent: Monday, February 02, 2004 5:41 PM
To: Struts-User (E-Mail)
Subject: html:options and html:select


hello,

I have following bean:

public class CProduct {

    private Integer id;

    private String name

    public Integer getId() {return id;}
    puclic void setId(Integer id){
...
}

My form class contains a java.util.List of CProduct bean.

How can I display the List as select box? I want to use the id as value
and the name as label of the select box.

For example:

<select name="ref">
    <option value="1">scanner</option>
    <option value="2">harddisk</option>
</select>

Has anyone an idea?

Regards,

Frank


Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to