[
https://issues.apache.org/jira/browse/SLING-604?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Felix Meschberger updated SLING-604:
------------------------------------
Fix Version/s: Scripting JavaScript 2.0.4
> Multi value properties not properly supported by ScriptableNode.get(String)
> method
> ----------------------------------------------------------------------------------
>
> Key: SLING-604
> URL: https://issues.apache.org/jira/browse/SLING-604
> Project: Sling
> Issue Type: Bug
> Components: Scripting
> Affects Versions: Scripting JavaScript 2.0.2
> Reporter: Felix Meschberger
> Assignee: Felix Meschberger
> Fix For: Scripting JavaScript 2.0.4
>
>
> It seems that mutlivalue properties are not properly supported by the
> ScriptableNode.get(String) method. The construct
> someNode.prop
> should return an array of values if the property is multi-valued even in the
> case of the array only containing a single value.
> Paul Davis reported in [1] that the construct
> <% for(var i=0; i <currentNode.trackId.length; i++) { %>
> <div><%= currentNode.trackId[i] %></div>
> <% } %>
> listed the single characters of the single value of the trackid property in
> case the trackid is a multi-valued property with just a single value. The
> actual property seems to be a proper multivalue property because
> var items = currentNode.getProperty("trackId").values;
> for( var i=0; i < items.length; i++ ) {
> ...
> }
> works correctly.
> [1] http://markmail.org/message/rbnsfolm3yq6thfv
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)