struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darren Hill <dh...@724.com>
Subject RE: nested:optionsCollection
Date Tue, 01 Oct 2002 18:01:13 GMT
Here's the source for my 2 beans ( parent, child ), the associated jsp and
the struts-config.xml

My struts-config.xml looks like this ...

Did I mention .. WOW .. thanks for your help.

I hate this little snags .. when I could be accomplishing more important
things.

D.

-----Original Message-----
From: Taylor, Jason [mailto:jtaylor@cobaltgroup.com]
Sent: October 1, 2002 1:53 PM
To: 'Struts Users Mailing List'
Subject: RE: nested:optionsCollection


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:dhill@724.com]
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:jtaylor@cobaltgroup.com]
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:dhill@724.com]
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:dhill@724.com]
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:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message