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
Reporter: Felix Meschberger
Fix For: Scripting JavaScript 2.0.2
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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.