Well, perhaps there is a way, but maybe not with Tapestry?

The @For component can look something like this:

<span jwcid="@For" source="ognl:lenders" value="ognl:currentLender"
keyExpression="objectId">

If you aren't familiar with Tapestry, this means to loop over
getLenders().  Each iteration over the collection sets the value with
setCurrentLender(aLender).  And the keyExpression becomes
getCurrentLender().getObjectId().  This works, but it serializes the
ObjectId for each row to the HTML.  When I used "objectId.hashCode" it
was trying getCurrentLender().getObjectId().getHashCode(), which failed.
Of course, that would have the problem mentioned earlier (with nulls).

I added a getHashCode() to my base DO which just wraps hashCode() and it
seems to be working now (bigger test to follow).  I get nice obscure
keys like "P10930889" stuck in the HTML.  (using
keyExpression="hashCode")  Safe and obscure.

Thanks,

/dev/mrg


-----Original Message-----
From: Kevin Menard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 21, 2006 1:17 PM
To: [email protected]
Subject: Re: Add getHashCode() to CayenneDataObject?


On Wed, 21 Jun 2006 12:53:58 -0400, Gentry, Michael (Contractor)  
<[EMAIL PROTECTED]> wrote:

> The System.identityHashCode() would probably work fine, but isn't
> callable by OGNL.  Come to think of it, just being able to call
> hashCode() from OGNL would be useful, too (and equivialent to
> System.identityHashCode()).

Are you sure about this?  I've called arbitrary methods from ognl
before.   
I think your problem is probably one more of order of resolution.  I
don't  
know for certain, but it may try to access bean properties first, then  
method calls, etc.

-- 
Kevin

Reply via email to