On Wed, 21 Jun 2006 14:15:29 -0400, Gentry, Michael (Contractor)
<[EMAIL PROTECTED]> wrote:
The @For component can look something like this:
<span jwcid="@For" source="ognl:lenders" value="ognl:currentLender"
keyExpression="objectId">
I'm not familiar with keyExpression, but I think the handling of ognl is
uniform throughout Tapestry.
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).
Well, I have some example method calls here. I know the first one will
make you cringe, but I'm not concerned with the PK being exposed in this
case (read-only entries):
<a href="#" jwcid="@ProductLink"
parameters="ognl:@[EMAIL PROTECTED](product)">
and:
<img alt="product image" jwcid="[EMAIL PROTECTED]"
image="ognl:product.getStoreImage(servletContext, webRequest,
requestCycle)"/>
Note the method arguments are exposed page properties.
So, I see no real reason that you can't call whatever method you'd like.
Off the cuff, it would seem that "objectId.hashCode()" would work.
--
Kevin