Sorry for the delay of my answer.

It seems that Jonathan is right : the data were retrieved by Hibernate as a Set. I have tried this morning to get a trace of this error but our code has come far beyond and i could not reproduce this error anymore. Sorry. If you need it, i can give you more informations about the context of the error.

Stephane

Jonathan Barker a écrit :
Actually, it wasn't the coercion to GridDataSource I was concerned about.
It looks like a Set is generated in the page, and then passed to the
component as a List and then that is used as the source for the grid.

(Having said that, is com.mycompany.MyType a custom type declared for
Hibernate?)

I experienced strange things back with T4, Hibernate and different
collection types and inheritance hierarchies when passing parameters.  At
the time I was a rookie with Hibernate, Spring and Tapestry so it was never
an issue of "should this work?" it was an issue of "what do I have to do to
make this work?"
In addition to the stack trace, the page code (particularly that portion
generating the collection) would be useful.

Jonathan

-----Original Message-----
From: Howard Lewis Ship [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 05, 2008 9:00 AM
To: Tapestry users
Subject: Re: Coercion error in grid

No, I'm pretty sure there's a built-in coercion from Collection to
GridDataSource.  Again, a stack trace would be helpful to figure out
what's really going on here (and the exact version of Tapestry).

On Fri, Apr 4, 2008 at 1:53 PM, Jonathan Barker
<[EMAIL PROTECTED]> wrote:
 It sounds like the underlying data (from the page) is in a Set, whereas
your
 component wants a List.  Try converting your Set to a List before
passing to
 the component.




 > -----Original Message-----
 > From: Howard Lewis Ship [mailto:[EMAIL PROTECTED]
 > Sent: Friday, April 04, 2008 2:58 PM
 > To: Tapestry users; [EMAIL PROTECTED]
 > Subject: Re: Coercion error in grid
 >
 > That is really, really odd.  A stack trace (and the exact version of
 > Tapestry you are using) would be helpful.ß
 >
 > On Fri, Apr 4, 2008 at 3:06 AM, Stephane Decleire
 > <[EMAIL PROTECTED]> wrote:
 > > Hi all,
 > >
 > >  When i try to show a list of my objects in a grid, i get the
following
 > > error :
 > >  "Could not find a coercion from type
 > org.hibernate.collection.PersistentSet
 > > to type com.mycompany.MyType"
 > >
 > >  Here is my component code :
 > >
 > >  public class UserAdsList {
 > >
 > >    @Parameter(required = true)
 > >    private List<Ad> ads = null;
 > >    public List<Ad> getAds() {
 > >        return ads;
 > >    }
 > >    public void setAds(List<Ad> ads) {
 > >        this.ads = ads;
 > >    }
 > >  }
 > >
 > >
 > >  and template :
 > >
 > >  <t:container
 > > xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
 > >
 > >  <t:grid source="ads"/>
 > >
 > >  </t:container>
 > >
 > >  Any idea ?
 > >
 > >  Stephane
 > >
 >
 >
 >
 > --
 > Howard M. Lewis Ship
 >
 > Creator Apache Tapestry and Apache HiveMind
 >
 > ---------------------------------------------------------------------
 > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > For additional commands, e-mail: [EMAIL PROTECTED]


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



--
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


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

Reply via email to