AnsweredAssumed Answered

icon16/32 always pointing to _default

Question asked by jsauer on Dec 15, 2009
Latest reply on Apr 12, 2011 by jboss
Hi,
just figured out a strange behaviour when displaying the filetypes icon through the icon16/icon32 properties.

It never works if I pass a collection of nodes to the model through JavaScript
list.get.js:

model.documents = node.children

list.get.json.ftl

<#list documents as doc>
   {
      "Name" : "${doc.name}",
      "Type" : "${doc.type}",
      "Icon16": "${url.context}${doc.icon16}",
      "Icon32": "${url.context}${doc.icon32}",
         …
I always end up getting _default.gif

If I pass the folder though
list.get.js:

if(node.isContainer) {
  model.folder = node
}
else {
  model.folder = node.parent
}

list.get.json.ftl

<#list folder.children as doc>
   {
      "Name" : "${doc.name}",
      "Type" : "${doc.type}",
      "Icon16": "${url.context}${doc.icon16}",
      "Icon32": "${url.context}${doc.icon32}",
         …
it works!

Any reasons for this behaviour? Should work  both ways, shouldn't it?

Thanks
Jörg

Outcomes