Reading Child/Grand Child properties in Sling Model | Community
Skip to main content
raghava_joijod1
Level 2
May 5, 2019 5:31 PM UTC
Solved

Reading Child/Grand Child properties in Sling Model

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
May 5, 2019 10:57 PM UTC

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

1 reply

arunpatidar
arunpatidarAccepted solution
New Participant
May 5, 2019 10:57 PM UTC

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)

Translate
Arun Patidar