Hi, On 19.08.2010 16:10, Clemens Wyss wrote: > you say getNodes() returns properties?
No, getNodes() returns a JavaScript object whose properties (in terms of JavaScript) are the childe nodes, where the index (label, key) is the child node name and the value is the child node. > > AND currentNode doesn't "provide" its child nodes? > > Is currentNode at all an instance of javax.jcr.Node? In JavaScript currentNode is an instance of JavaScript wrapper for javax.jcr.Node but node javax.jcr.Node. Regards Felix > >> -----Original Message----- >> From: Felix Meschberger [mailto:[email protected]] >> Sent: Thursday, August 19, 2010 4:01 PM >> To: [email protected] >> Subject: Re: Why does currentNode.getNodes() not return a >> NodeIterator? >> >> >> Hi Clemens, >> >> This is a problem of an early decision to convert the result of a >> getNodes() call into a JavaScript object where the returned nodes are >> properties. >> >> Thus the result is not a NodeIterator, unfortunately. >> >> Regards >> Felix >> >> On 19.08.2010 15:37, Clemens Wyss wrote: >>> my esp script starts as follows: >>> if (currentNode) >>> { >>> var nodes = currentNode.getNodes( ); >>> >>> var size = nodes.getSize(); >>> ... >>> >>> I keep getting: >>> Uncaught SlingException org.mozilla.javascript.EcmaError: >> TypeError: getSize is not a function, it is >> org.mozilla.javascript.Undefined >>> >>> what am I missing? I know I shouldn't be usign currentNode >> at all, but after all currentNode is not null and the doc >> says that getNodes() always returns a NodeIterator... >>
