Not being purposely vague here (am away from a computer and don't have the 
syntax memorized), but... You need to use the JCR API. Something like getting a 
NodeIterator and using the typical hasNext() and nextNode() methods.

On Aug 5, 2010, at 7:47 PM, Tony Giaccone <[email protected]> wrote:

> 
> 
> 
> So I'm trying to get the data in the lineItems. 
> 
> Here's the XML fragment
> 
> <lineItems jcr:primaryType="sling:OrderedFolder" 
> jcr:created="2010-08-02T19:54:57.329-04:00" jcr:createdBy="admin">
>    <_x0031_ jcr:primaryType="nt:unstructured" lineItemSeq="1" itemId="55"  
> itemDescr="Item selected to purchase" 
> sling:resourceType="mll/item"></lineItems>
> 
> 
> I tried this:
> 
> 
>                <% var items = currentNode.lineItems; %>
>                <% for (var i = 0;i<items.length;i++) %>
>                <% { %>
>                <%= currentNode.lineItems[i].itemDescr %>
>                <% } %>
>                <b> End of loop</b><br/>
> 
> And get this message:
> 
> TypeError: Cannot read property "shortDescr" from undefined 
> 
> 
> 
> 
> 
> So I change it to this:
> 
>                <% var items = currentNode.lineItems; %>
>                <% for (var i = 0;i<items.length;i++) %>
>                <% { %>
>                <%= currentNode.lineItems[i] %>
>                <% } %>
>                <b> End of loop</b><br/>
> 
> This is what I get..
> undefined End of loop
> 
> Change the code to this:
> 
>                <% var items = currentNode.lineItems; %>
>                <% for (var i = 0;i<items.length;i++) %>
>                <% { %>
>                <%= currentNode.lineItems %>
>                <% } %>
>                <b> End of loop</b><br/>
> 
> And I get this:
> 
> content/Documents/2008/1155383/Order/2_1280793297315/lineItems
> End of loop
> 
> I'm guessing I need to do something to load that node(?) into the page? 
> 
> 
> Tony

Reply via email to