cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robby.pelss...@vodafone.com
Subject RE: TypeError: getStock is not a function.
Date Fri, 14 Jan 2005 13:17:01 GMT
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: robby.pelssers@vodafone.com [mailto:robby.pelssers@vodafone.com] 
Sent: vrijdag 14 januari 2005 13:23
To: users@cocoon.apache.org
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:uzo@beyarecords.com] 
Sent: vrijdag 14 januari 2005 13:06
To: users@cocoon.apache.org
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


Mime
View raw message