Hi,

could someone please take a look at this snippet of code and let me know
what i'm doing wrong?  I built this from snippets of facts that I found
throughout the messages on the list..  please let me know if any info is
incorrect..

Thanks,
Minh


In the following code.. I have several nested object.. I need to access..
on the highest level.. I have an orderForm which contains a collection of
shipSets..  I access each shipSet using the outside iterator..     now...
each shipSet contains.. a collection of lineItems...  so for each of the
shipSets..  I have another iterator.. that goes through all the lineItems
within the shipSet..   all of this works.. fine...  but here is the tricky
part... each of my lineItems.. contain a lineItemInfo which in turn has an
itemInfo object.... within the itemInfo object is "description"... which is
the value I want to get to...

assuming both iterator works(because they do.. and i've tested them..)...
lets look at the second iterator.. at this point.. I have a handle on each
lineItemInfo object for every iteration..  I would like to be able to do
<bean:write name="lineItemInfo.itemInfo" property="description"/>   where I
can write out the description from within the itemInfo object held by the
lineItemInfo of the current iteration....  this doesn't work... the server
always gives me back an error saying  "X Servlet Error: Cannot find bean
lineItemInfo.itemInfo in scope null".  

If you look a few lines above.. you will notice "<bean:write
name="lineItemInfo" property="quantity"/>"... which does work...  here...
quantity is in the lineItemInfo object..

I've seen many examples on this list of doing... something like <bean:write
name="lineItemInfo.itemInfo" property="description"/>... is this faulse
information?

Thanks,
Minh

        <logic:iterate id="shipSetInfo" name="orderForm"
property="shipSets">
        <tr>
                <td colspan=3 bgcolor="#DBEAF5">
                        <font class="title">
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <bean:write name="shipSetInfo"
property="id"/>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <bean:write name="shipSetInfo"
property="formattedShipDate"/>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <html:link
page="/editLineItem.do?action=Create" styleClass="PAGELINK"
paramId="shipSetID" paramName="shipSetInfo" paramProperty="id">New Line
Item</html:link></td>
                        </font>
                </td>
        </tr>
                <logic:iterate id="lineItemInfo" name="shipSetInfo"
property="lineItems">
                <tr>
                        <td align="center">
                                <bean:write name="lineItemInfo"
property="quantity"/>
                        </td>
                        <td>                            
                                <bean:write name="lineItemInfo.itemInfo"
property="description"/>
                        </td>
                        <td>
                                <html:link page="/editLineItem.do"
styleClass="PAGELINK">Edit Line Item</html:link>
                        </td>
                </tr>
                </logic:iterate>
        </logic:iterate>

Reply via email to