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

Reading Child/Grand Child properties in Sling Model

  • May 5, 2019
  • 1 reply
  • 1088 views

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.
Best answer by arunpatidar

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)

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
May 5, 2019

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