Title: Message
Some code like this would be likely to work:
 
for (i =0; i < neworder.getOrderItems().size(); i++) {
    var orderitem = neworder.getOrderItems().get(i);
    if (orderitem.getStock().getItemTitle().equals("abcd") {
        .....do something.....
    }
 
}
 
Maybe someone a little more familiar with javasyntaxis could be of more help...
 
Kind regards,
Robby
 
 
----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: vrijdag 14 januari 2005 13:23
To: [email protected]
Subject: RE: TypeError: getStock is not a function.

Check first if an orderitem has a method getStock().... This error seems to imply is doesn't ...
 
But i'll have to admit that it's strange it works in the jx.
 
In the jx your variable orderitem is automatically an object from the class OrderItem.... I don't know if you use the correct syntaxis in the _javascript_...
 
Maybe you'll still need to check if your variable orderitem is from the correct type of class.
-----Original Message-----
From: beyaRecords [mailto:[EMAIL PROTECTED]
Sent: vrijdag 14 januari 2005 13:06
To: [email protected]
Subject: TypeError: getStock is not a function.

Hi,

I'm sure that this is a simple one but it eludes me at the moment. I have 2 identical operations happening both in a jx page as well as a validation form:


jx page:


        <jx:forEach var="orderitem" items="${neworder.getOrderItems()}">

        <tr>

                <td class="normaltext">${orderitem.getStock().getItemTitle()}</td>

        </tr>

        </jx:forEach>


and in my formvalidation.xml:


      <fd:_javascript_>

                        for (var orderitem in neworder.getOrderItems()){ <---------- This line is fine.

                                if (orderitem.getStock().getItemTitle() == "abcd") { <----- This line is causing the error.

                                        ...do something.....

                                }

                        }

      </fd:_javascript_>


The code in the jx page works, but the _javascript_ in the xml file gives the above mentioned error message. What am I missing here?


regards


Uzo

Reply via email to