[
https://issues.apache.org/jira/browse/SLING-291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Carsten Ziegeler resolved SLING-291.
------------------------------------
Resolution: Won't Fix
> Clarify and test access to multi-valued Properties from server-side javascript
> ------------------------------------------------------------------------------
>
> Key: SLING-291
> URL: https://issues.apache.org/jira/browse/SLING-291
> Project: Sling
> Issue Type: Improvement
> Components: Scripting
> Affects Versions: Scripting JavaScript 2.0.2
> Reporter: Bertrand Delacretaz
> Priority: Minor
>
> In SLING-282, Michael Marth writes:
> 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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)