Failing to get currentPage in component that's locked in the template [AEM 6.5]
Hey guys, hope you doing fine.
I am facing a problem with getting the currentPage in a component in AEM 6.5 with SPA.
I am trying to get the current page inside of a model that is mapped to a component that is locked in a template, I think if I had the component unlocked the code to get the current page would work just fine but as I really need to use that component locked I have this issue.
Does anyone have any sugestion to me?
Down bellow follows the code to get the currentPage
@586265
private Page currentPage;
public Page getCurrentPage() {
return currentPage;
}
the problem is that it is getting the first page from bottom up and not the correct page. As if It is returning the first that is found. And another problem that I found is that if I change the name of the attribute to another name other them currentPage, like resourcePage for example that return would be null.
If you guys have any suggestion feel free to answer here or direct message me. Thank you in advance.