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
  •  | 
  •  

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?

有帮助吗?

解决方案

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>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top