Inject child nodes that were created by eaem-nested="NODE_STORE" in a Sling Model
Hi guys,
I have a dialog that has a multifield with a complex object type identified by the snippet below:
<foo
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/multifield"
fieldLabel="Foo">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/fieldset"
eaem-nested="NODE_STORE"
name="./foo">
<layout
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/layouts/fixedcolumns"
method="absolute"/>
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/container">
<items jcr:primaryType="nt:unstructured">
<bar1
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldLabel="Bar1"
name="./bar1"/>
<bar2
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldLabel="Bar2"
name="./bar2"/>
<bar3
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/textfield"
fieldLabel="Bar3"
name="./bar3"/>
</items>
</column>
</items>
</field>
</foo>
I've used eaem-nested="NODE_STORE" to generate a new node per multifield entry in order to keep things organized.
The structure in the repository looks like this:


I'm trying to inject this in my Sling Model but without success. I've already tried the examples below but without success.
@Inject
private List<Foo> foo; // Null element
@Inject
private List<Resource> foo; // List with only one element (i.e. foo child node)
@ChildResource
private List<Resource> foo; // List with only one element (i.e. foo child node)
Any ideas on how to inject this type of structures properly?
Thanks!
Diogo