On 3/13/08, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote:
> On Thu, Mar 13, 2008 at 2:47 PM, Felix Meschberger <[EMAIL PROTECTED]> wrote:
>  >  ...The second option - using the node - you do
>  >         var child = ...
>  >         var childNode = child.adaptTo(Packages.javax.jcr.Node);
>  >         if (childNode != null && childNode.hasProperty("title")) {
>  >             var titleString =
>  >         childNode.getProperty("title").getString();
>
> >         }...
>
>  This is IMHO ugly, and the Resource option that you suggest is quite
>  involved as well for a simple thing.
>
>  To be consistent with the way we handle nodes in server-side
>  javascript I think this should be written like (warning that code
>  won't work now):
>
>
>  var iterator = resource.resourceResolver.listChildren(r);
>
> var r = iterator.next();
>  var titleString = r.node.title;
>
>  Which would mean re-adding the ScriptableResource.jsGet_Node() method
>  that was removed in revision 631980

Yes, please :)
This kind of operation (listing children as a menu) will be a fairly
common task - at least in my world.

-- 
Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no
Akersgata 16, N-0158 Oslo, Norway

Reply via email to