Inject Child Pages using Sling Models
Hi,
Is it possible to inject the Child Pages using Sling models?
Thanks
Hi,
Is it possible to inject the Child Pages using Sling models?
Thanks
What is your usecase. Injecting child resource is possible. Please refer to https://sling.apache.org/documentation/bundles/models.html
List injection for child resources works by injecting grand child resources (since Sling Models Impl 1.0.6). For example, the class
@Model(adaptables=Resource.class)public class MyModel {@Injectprivate List<Resource> addresses;}
Is suitable for a resource structure such as:
+- resource (being adapted)|+- addresses|+- address1|+- address2
In this case, the addresses List will contain address1 and address2.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.