It is possible to use a collection of objects generated in the referenceData
method, I don't think that this the problem in your code.
I think that you have a wrong value in your "path" attribute:
If your command object has a setter called "setInspector(String inspector)",
your form tag would look like <form:select path="inspector"
items="${inspectors}" itemLabel="name" itemValue="id"/>
Please take a close look at the "path" notation:
The value must be the same as the corresponding setter / getter in your
command object (...setInspector(...) / getInspector(...)->
path="inspector"). In your example (1. mail), the value is
"...path="inspectors"....". Maybe the "s" is wrong there...
Bye,
Peter
PS: The error message corresponds to the "path" attribute, not to one of the
other attributes (items, itemValue od itemLabel):
>>Invalid property 'inspectors' of bean class
[com.mycompany.myapp.model.PackageInspection]: Bean property >'inspectors'
is not readable or has an invalid getter method
-----Ursprüngliche Nachricht-----
Von: syg6 [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 6. August 2007 14:49
An: [email protected]
Betreff: Re: [appfuse-user] AW: Can I use form:select with data bound using
referenceDate()
Hi Peter, thanks for the response,
I read the reference guide already and unfortunately it only has one
example, when your command object has a getter for the reference data you
want to use to populate a Select. I don't have this option because my
command object, PackageInspection, has exactly one Inspector, not a list of
Inspectors.
I would think this is a pretty normal thing to want to do, but it looks as
if the form:select tag only works with objects within the command object.
Am I wrong about this?
Cheers,
Bob
Absolut wrote:
>
> Hi Bob!
>
> I think the problem is the part ... path="inspectors"... It seems that
> your command object of the type "PackageInspection" has no property
> "inspectors"
> (or no method "getInspectors()")
>
> There are many ohter possibilities how to generate an "select" tag
> with the new Spring Taglib.
> For more details i would recomend to read
> "http://static.springframework.org/spring/docs/2.0.x/reference/mvc.htm
> l#mvc-
> formtaglib"
>
> Bye,
>
> Peter
>
> -----Ursprüngliche Nachricht-----
> Von: syg6 [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 6. August 2007 14:34
> An: [email protected]
> Betreff: [appfuse-user] Can I use form:select with data bound using
> referenceDate()
>
>
> All the posts I see, here on the AppFuse mailing list and all over the
> net, use the old spring:bind tag. Can I use the Spring 2.0 form:select
> tag?
>
> I have implemented referenceData() in my XxFormController class, and
> add a Map of Inspectors to the Model. But in the jsp, the following code:
>
> <form:select path="inspectors" items="${inspectors}" itemLabel="name"
> itemValue="id"/>
>
> gives me this:
>
>>Invalid property 'inspectors' of bean class
> [com.mycompany.myapp.model.PackageInspection]: Bean property >'inspectors'
> is not readable or has an invalid getter method
>
> Ostensibly this is because Inspectors is not part of the 'command'
> class, PackageInspection, but rather a list of Inspectors added to the
> request via
> referenceData() to populate a Select.
>
> Can I use the select tag or do I have to use the old bind tag?
>
> Thanks,
> Bob
> --
> View this message in context:
> http://www.nabble.com/Can-I-use-form%3Aselect-with-data-bound-using-re
> ferenc
> eDate%28%29-tf4223839s2369.html#a12015409
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.476 / Virus Database: 269.11.6/938 - Release Date:
> 05.08.2007
> 16:16
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.476 / Virus Database: 269.11.6/938 - Release Date:
> 05.08.2007
> 16:16
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Can-I-use-form%3Aselect-with-data-bound-using-referenc
eDate%28%29-tf4223839s2369.html#a12015604
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.11.6/938 - Release Date: 05.08.2007
16:16
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.11.6/938 - Release Date: 05.08.2007
16:16
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]