Hi,

Sounds like the ScriptableNode wrapper returns currentNode.trackId as a single property instead of an array of properties. This single property is then converted to a string and the characters iterated.

Do you store the property in a node of a special node type or is it of type nt:unstructured ? Can you tell me whether the property is mult-value: currentNode.getProperty("trackId").definition.isMultiple() would return true. Otherwise false is returned.

The reason why I ask is to try and find out, whether your problem happens upon storage in SlingPostServlet or up "read" in the ScriptableNode wrapper.

Regards
Felix


Paul Davis schrieb:
Hi,

I've got a form where there my be an arbitrary number of items.
However, I have a problem when there is only one item.

I've added the type hint
<input type="hidden" name="[EMAIL PROTECTED]" value="String[]" />
The type hint works when I get the json string. The value is correctly
wrapped in square brackets.

However, in my esp, it iterates the letters of the value (if there is only one)
<% for(var i=0; i <currentNode.trackId.length; i++) { %>
     <div><%= currentNode.trackId[i] %></div>
<% } %>

I tried using the typeof(obj) operation in a test but, it returns
"object" regardless.

ideas?

thanks

Reply via email to