Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
Scripting JavaScript 2.0.2
-
None
Description
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.
Attachments
Issue Links
- duplicates
-
SLING-534 Multi-Value Reference properties are not exposed to scripting the same way as single-value reference properties
- Closed