Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Reading Child/Grand Child properties in Sling Model

Avatar

Level 2

Hi,

Is there any way we can access child/grand child valuemap in sling model.

Ex.  If my current resource is "/content/1/2"

And I would like to read property available at node "/content/1/2/x/y/5",  and x, y values may vary.

I found DeepModifiableValueMapDecorator,  will this help?

Thanks,

Raghava

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

you can inject self as reosurce and check other childs(grand childs) with java code using Resource API.

@Self

    private Resource resource;

Resource (Apache Sling 8 API)



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

you can inject self as reosurce and check other childs(grand childs) with java code using Resource API.

@Self

    private Resource resource;

Resource (Apache Sling 8 API)



Arun Patidar