Sling Models: Using @Source("child-resources")
I have not been able to get the "child-resources" injector to work within the @Source annotation.
Documentation I am using: http://sling.apache.org/documentation/bundles/models.html
I have tried to use the @Inject with a List<Resources> object. Does anyone have an example of this injector working? The ACS Commons does not have an example of this. My model works when I remove the children code and only get the title.
package com.github.models.models; import java.util.List; import javax.inject.Inject; import javax.inject.Named; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; import org.apache.sling.models.annotations.Source; @Model(adaptables=Resource.class) public class Region { @Inject @Named("jcr:title") private String title; @Inject @Source("child-resources") private List<Resource> children; public String getTitle() { return title; } public List<Resource> getChildren() { return children; } }
