0

I'm creating a module for Business Manager, but when I render the template and try to use pdict to loop it, it works for the first loop, but only one loop per render. If there is more than 1 loop in this template, the others will be ignored, why?

pageContent.isml

<isset name="orders" value="${pdict.orders}" scope="page" />
<tbody>
    **FIRST LOOP - Works fine**
    <isloop items="${orders}" var="order">
        <tr>
            <td>${order.orderNo}</td>
        </tr>
    </isloop>

    **SECOND LOOP - Dont Work properly, it is ignored**
    <isloop items="${orders}" var="orderX">
        <tr>
            <td>${orderX.orderNo}</td>
        </tr>
    </isloop>
</tbody>

Controller.js

function getOrders() {
    var viewObj = null;
    var ordersList;
    var orders = OrderMgr.queryOrders('orderNo == {0}', 'creationDate desc', '123456');
    ordersList = orders.asList();
    orders.close();
    viewObj = {
        orders: ordersList
    };
    app.getView(viewObj).render('pageContent');
}

exports.GetOrders = guard.ensure(['https'], getOrders);

0

You must log in to answer this question.

Browse other questions tagged .