The error indicates your problem is your class, not your tag syntax.  

What class is your employeeList?  It has to be something that extends
java.util.Collection or a primitive array of objects to work as a collection
attribute of the options tag.  

The best documentation is source code-- I'd look at that if you're getting
frustrated...

-----Original Message-----
From: Darren Hill [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 01, 2002 10:12 AM
To: 'Struts Users Mailing List'
Subject: RE: nested:optionsCollection


Sorry Jason .. I get 

javax.servlet.jsp.JspException: Cannot create iterator for
com.blah.blah.form.EmployeeForm@69d0cc

error.

Man ... I wish there was documentation somewhere about this.

D.
-----Original Message-----
From: Taylor, Jason [mailto:[EMAIL PROTECTED]]
Sent: October 1, 2002 12:43 PM
To: 'Struts Users Mailing List'
Subject: RE: nested:optionsCollection


try 
<nested:options collection="employeeList" property="id"
labelProperty="firstName"/>

-----Original Message-----
From: Darren Hill [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 01, 2002 9:39 AM
To: 'Struts Users Mailing List'
Subject: RE: nested:optionsCollection


Ok I'm close ... but this ...

        <nested:select property="id">
            <nested:options property="employeeList"/>
        </nested:select>

Gives me a list of the employee Objects ... how can I access the firstName
and id?

<nested:options property="employeeList" labelName="firstName"
labelValue="id"/> doesn't work.

D.

-----Original Message-----
From: Darren Hill [mailto:[EMAIL PROTECTED]]
Sent: October 1, 2002 12:18 PM
To: 'Struts Users Mailing List'
Subject: nested:optionsCollection


K ... so I have nested beans and all is well.

I just want to know the syntax of creating a single select.

My company bean contains an arraylist of employee beans ( everything works
will so far )

ie.  This works fine 

<nested:iterate property="employeeList">
     <nested:text property="firstName"/>
</nested:iterate>

I want to produce this.

<select name="employeeid">
  <option value="1">Darren1</option>
  <option value="2">Darren2</option>
  <option value="3">Darren1</option>
</select>

using this ... 

<nested:select property="employeeList" >
     <nested:optionsCollection property="firstName" value="id" />
</nested:select>

Obviously my syntax is wrong 'cause I get this ...

javax.servlet.jsp.JspException: No getter method for property firstName of
bean
org.apache.struts.taglib.html.BEAN

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

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

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

Reply via email to