Hi!

Maybe you need to change
<form:options items="customers" itemValue="id" itemLabel="name"/>
to
<form:options items="${customers}" itemValue="id" itemLabel="name"/>

Bye,

Peter

2007/10/12, George.Francis <[EMAIL PROTECTED]>:
>
>
> Hello,
> I have just moved on from the tutorials and I'm having trouble creating an
> association in my Spring MVC WebApp between a 'Customer' bean and an
> 'Application' bean.  In my datamodel an Application 'has a' Customer, and
> so
> my Application bean has a member of type Customer.  I've created the
> managers and controllers, and in my applictionform.jsp (where I want to
> display a list of Customers to associate with the Application) I have:
>
> <li>
>         <appfuse:label styleClass="desc" key="application.customer"/>
>         <form:errors path="customer" cssClass="fieldError"/>
>         <form:select path="customer">
>                 <form:options items="customers" itemValue="id"
> itemLabel="name"/>
>         </form:select>
> </li>
>
> In my dispatcher-servlet.xml I have added <property name="customerManager"
> ref="customerManager"/> to my applicationFormController bean.  In the
> ApplicationFormController class I have a setCustomerManager method, and a
> referenceData() method that has:
>
> HashMap hashMap = new HashMap();
> hashMap.put( "customers", customerManager.getAll()  );
> return hashMap;
>
> However, when I try to edit an Application, when it tried to render the
> Application edit form I get the error:
>
> OptionsTag.doStartTag(80) | Type [java.lang.String] is not valid for
> option
> items.
>
> Can someone please tell me what I'm missing?  Why is "customers" in
> applicationform.jsp being interpreted as a String, as opposed to the
> customer LIst I am injecting in ApplicationFormController's
> referenceData()
> ?
>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Simple-example-of-bean-association-tf4613826s2369.html#a13175805
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to