Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-604

Multi value properties not properly supported by ScriptableNode.get(String) method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • Scripting JavaScript 2.0.2
    • Scripting
    • 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.

      [1] http://markmail.org/message/rbnsfolm3yq6thfv

      Attachments

        Issue Links

          Activity

            People

              fmeschbe Felix Meschberger
              fmeschbe Felix Meschberger
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: