[
https://issues.apache.org/jira/browse/SLING-282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12572958#action_12572958
]
Michael Marth commented on SLING-282:
-------------------------------------
this might be related (regarding collections handling):
the property "to" is multivalued.
in the script I do something like:
<%= currentNode["to"][0] %>
if the value of "to" has only one value I seem to get back this value as one
string so [0] gives me the first character. if "to" has 2 values I get back a
collection so [0] gives me the first element. this is consistent with what
["to"].length gives me.
I am not 100% sure if this is a bug (might be my lack of understanding for
javascript), if so a comment on how to determine the result length of a
multi-valued property would be appreciated.
> missing node functions in node wrapper
> --------------------------------------
>
> Key: SLING-282
> URL: https://issues.apache.org/jira/browse/SLING-282
> Project: Sling
> Issue Type: Bug
> Components: Launchpad
> Reporter: Michael Marth
> Assignee: Bertrand Delacretaz
>
> (this is on Launchpad revision 629151 running on top of crx)
> got an esp template that looks like:
> <h1><%= resource.node %>: <%= resource.node.getName() %></h1>
>
> <%
> var child = resource.node.getNode("2008-02")
> if (child.getProperty("sling:resourceType") == "emailListMonth") {
> %>yay<%
> }
> %>
> .getName() and .getNode("...") works OK, but .getProperty throws an exception:
> TypeError: getProperty is not a function
> same for .getNodes()
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.