In alfresco, is it possible to traverse child Associations in freemarker when using java backed controllers for webscripts?

StackOverflow https://stackoverflow.com/questions/22842555

  •  27-06-2023
  •  | 
  •  

Question

Am I correct in assuming that one can only walk the childAssocs tree of an object put into the model when a javascript controller is used to dump the object in the model?

Was it helpful?

Solution

no, you can also add a NodeRef to the model in your java controller, e.g.:

Map<String, Object> model = new HashMap<String, Object>();
model.put("folder", folderNodeRef);
return model;

afaik a nodeRef is automatically evaluated to a TemplateNode when passed to your ftl:

<#list folder.children as child>
 .....
</#list>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top