struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Miles" <ch...@chrismiles.org>
Subject Re: Nested Iterator Problem
Date Mon, 28 Jun 2010 20:13:20 GMT
In the second Iterator I have just got

<s:iterator value="#individualDetail.products" var="product">
            <br/>
            <ul class="confirmOrderShippingDetailsProduct">
                <li><strong><s:property 
value="#product.name"/></strong></li>
                <li><s:property value="#product.name"/></li>
            </ul>
        </s:iterator>


The resuling HTML looks like.


<div class="confirmOrderShippingDetails">
        <span><strong>Address 1 of 1</strong></span>
        <br/>
        <br/>
        <ul class="confirmOrderShippingDetailsAddress">
            <li>Chris Miles</li>
            <li>aaaa</li>
            <li>bbbb</li>
            <li>cccc</li>
        </ul>

            <br/>
            <ul class="confirmOrderShippingDetailsProduct">
                <li><strong>This is a product name</strong></li>
                <li>
</div>

I am calling the same property twice so there is no reason it should fail 
but as you can see it bombs out right at the point where it should be 
displaying the property. The parent iterator continues as normal.

I have set all Struts and XWork logging to DEBUG and there is no errors or 
warnings indicating a problem whatsoever.

Thanks

Chris
----- Original Message ----- 
From: "Chris Miles" <chris@chrismiles.org>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, June 25, 2010 9:51 PM
Subject: Nested Iterator Problem


Hi

I am running a nested iterator as follows:

<s:iterator value="shippingDetails" var="individualDetail" status="stat">
    <div class="confirmOrderShippingDetails">
        <span><strong>Address <s:property value="#stat.index+1"/> of 
<s:property value="shippingDetails.size"/></strong></span>
        <br/>
        <br/>
        <ul class="confirmOrderShippingDetailsAddress">
            <li><s:property value="#individualDetail.firstName"/> 
<s:property value="#individualDetail.lastName"/></li>
            <li><s:property value="#individualDetail.houseNumberName"/> 
<s:property value="#individualDetail.streetName"/></li>
            <li><s:property value="#individualDetail.cityTown"/></li>
            <li><s:property value="#individualDetail.districtCounty"/>, 
<s:property value="#individualDetail.postCode"/></li>
        </ul>
        <s:iterator value="#individualDetail.products" var="product">
            <br/>
            <ul class="confirmOrderShippingDetailsProduct">
                <li><strong><s:property 
value="#product.name"/></strong></li>
                <li><span 
class="confirmOrderShippingDetailsProductPrice">£<s:property 
value="#product.price"/></span></li>
            </ul>
        </s:iterator>
    </div>
</s:iterator>

Rendering fails as soon as the second property (price) is called on the 
product. Price exists and just for testing purposes I tried to render the 
product name a second time instead and it still fails. Any more HTML which 
is to be displayed within that iterator never gets rendered and the parent 
iterator continues.

No errors being debugged anywhere.

I can not figure this out.

Thanks

Chris 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message