[ 
https://issues.apache.org/jira/browse/SLING-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12567123#action_12567123
 ] 

Bertrand Delacretaz commented on SLING-240:
-------------------------------------------

In revision 619952, I have added a "children" property to Scriptable resource, 
but currently this returns a java Iterator as it didn't work correctly using a 
ScriptableItemMap (see comments in code).

I've added a launchpad-webapp test that uses the following code to recursively 
dump a Resource:

function dumpResource(r, level) {
        out.print(level + " " + r + '\n');
        var iterator = r.children;
        while(iterator.hasNext()) {
                dumpResource(iterator.next(), level + 1);
        }
}

dumpResource(resource, 1);

Leaving this issue open, as a better solution using the appropriate javascript 
wrapper instead of an Iterator is needed.


> Improve iteration of child Resources in ScriptableResource
> ----------------------------------------------------------
>
>                 Key: SLING-240
>                 URL: https://issues.apache.org/jira/browse/SLING-240
>             Project: Sling
>          Issue Type: Improvement
>            Reporter: Bertrand Delacretaz
>            Priority: Minor
>
> The ScriptableResource should allow convenient access in javascript to the 
> ResourceProvider.listChildren() method, to render hierarchies easily.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to