I'm trying to combine displaytag with Spring a somewhat challenging way
and hope someone out there can shed some light on a problem I'm having.

What I'd like to be able to do is use displaytag to handle displaying a
table of items.  To test the concept, I've adapted the Spring MVC
step-by-step app at
http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step.html.
I've added a property to the Product bean named category and added a few
products so that I've got 6 products in 3 categories.

For each item (row) in the table, I'll display some properties, very
standard stuff.  I've got this part working and am able to properly
display my category as a string.  So the basic data is fine: I've got a
category property and it's getting out to the display view properly.

Now the tricky part: I want to use the spring:bind and spring:transform
tags to convert this data into a drop-down list (i.e., the select tag;
don't worry about why I need to do this, I just do!).  But just binding to
each object causes an error.  For example, I have:

<display:table name="model.products" id="product">
    <display:column property="description"/>
    <display:column property="price"/>
    <display:column title="Category">
        <spring:bind path="product">
            <c:forEach items="${status.errorMessages}" var="error">
            Error code: <c:out value="${error}"/><br/>
            </c:forEach>
        </spring:bind>
    </display:column>
</display:table>

This gives the following exception: Neither Errors instance nor plain
target object for bean name 'product' available as request attribute

It's not that the row object isn't there.  I can remove that category
column and replace it with this:

<display:column title="Category">
    <c:out value="${product.category}"/>
</display:column>

This displays the product category properly, which means that each object
extracted from the list by displaytag is properly resolving.  I tried
this, which is a bit left field:

<spring:bind path="model.products[<%=product_rowNum.intValue()%>]">

The idea here was that I could address the collection from the products
property.  This failed pretty badly :^)

What am I missing here?  This has to be possible, but I can NOT figure it
out.  The only thing that I can think of is that spring:bind needs a bean,
meaning I'd need to do something similar to the bean:define tag in Struts,
but I'm not certain what that would be within Spring.

Any help with this issue would be greatly appreciated!

-- 
Rick Herrick
[EMAIL PROTECTED]

I haven't got time for inner peace.

Get out of control, but appear under control. It's not bad to alarm other
people, though--it's good for them.--Hunter S. Thompson


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to