<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Failing to get currentPage in component that's locked... in Adobe Experience Manager Questions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/457554#M131777</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;LI-USER uid="13133911"&gt;&lt;/LI-USER&gt;&amp;nbsp;, did you fix this? I'm having the same problem. I think it's related to those annotations. But I wasn't able to make it work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even this line doesn't work because current resource is in the template and the resultant currentPage will be structure of that template.&lt;/P&gt;&lt;PRE&gt;currentPage = request.getResourceResolver().adaptTo(PageManager.class).getContainingPage(resource);&lt;/PRE&gt;</description>
    <pubDate>Wed, 22 Jun 2022 21:08:34 GMT</pubDate>
    <dc:creator>GonzaloCalandria</dc:creator>
    <dc:date>2022-06-22T21:08:34Z</dc:date>
    <item>
      <title>Failing to get currentPage in component that's locked in the template [AEM 6.5]</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407295#M4266</link>
      <description>&lt;P&gt;Hey guys, hope you doing fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am facing a problem with getting the currentPage in a component in AEM 6.5 with SPA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get the current page inside of a model that is mapped to a component that is locked&amp;nbsp; 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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any sugestion to me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Down bellow follows the code to get the currentPage&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;LI-USER uid="586265" login="inject"&gt;&lt;/LI-USER&gt;&lt;BR /&gt;private Page currentPage;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public Page getCurrentPage() {&lt;BR /&gt;return currentPage;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you guys have any suggestion feel free to answer here or direct message me. Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Sat, 08 May 2021 22:26:43 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407295#M4266</guid>
      <dc:creator>VasconcelosAqui</dc:creator>
      <dc:date>2021-05-08T22:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to get currentPage in component that's locked...</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407299#M4267</link>
      <description>&lt;P&gt;Please check below Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;Model&lt;/SPAN&gt;&lt;SPAN&gt;(adaptables&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SlingHttpServletRequest&lt;/SPAN&gt;&lt;SPAN&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p;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;currentPage&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getPath&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&amp;lt;div data-sly-use.example="&lt;SPAN&gt;com.sling.models.core.models.TestModel&lt;/SPAN&gt;"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;${example.path}&amp;lt;br/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sun, 09 May 2021 03:08:30 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407299#M4267</guid>
      <dc:creator>Bhuwan_B</dc:creator>
      <dc:date>2021-05-09T03:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to get currentPage in component that's locked...</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407302#M4268</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;LI-USER uid="13133911"&gt;&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks like it's an existing issue as mentioned here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/adobe/aem-sample-we-retail-journal/issues/53" target="_blank" rel="noopener"&gt;https://github.com/adobe/aem-sample-we-retail-journal/issues/53&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a workaround you can use the below approach:&lt;/P&gt;&lt;PRE&gt;currentPage = request.getResourceResolver().adaptTo(PageManager.class).getContainingPage(resource);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 04:09:03 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407302#M4268</guid>
      <dc:creator>Asutosh_Jena_</dc:creator>
      <dc:date>2021-05-09T04:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to get currentPage in component that's locked...</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407436#M4269</link>
      <description>Hey &lt;LI-USER uid="17201252" login="Bhuwan_B"&gt;&lt;/LI-USER&gt; I tried this but that also didn't work, I also would like to point that that is not a simple Sling Use Model, that is actually a Model that implements component exporter and I also would like to point that the component is beeing instanciated by the template and its blocked in the the template. I think is the main reason why that does not work.</description>
      <pubDate>Mon, 10 May 2021 11:25:14 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407436#M4269</guid>
      <dc:creator>VasconcelosAqui</dc:creator>
      <dc:date>2021-05-10T11:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to get currentPage in component that's locked...</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407437#M4270</link>
      <description>Hey &lt;LI-USER uid="7532759" login="asutosh_jena"&gt;&lt;/LI-USER&gt; I also tried this before but that also didnt work, cause the resource is not different for each page, as the component is locked in the template the resource is the same for every single page. I think that is the main reason why that does not work.</description>
      <pubDate>Mon, 10 May 2021 11:27:13 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407437#M4270</guid>
      <dc:creator>VasconcelosAqui</dc:creator>
      <dc:date>2021-05-10T11:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to get currentPage in component that's locked...</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407439#M4271</link>
      <description>I will suggest to raise a ticket with adobe support with this use case and for time being go with unlocking the component.</description>
      <pubDate>Mon, 10 May 2021 12:05:36 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/407439#M4271</guid>
      <dc:creator>Asutosh_Jena_</dc:creator>
      <dc:date>2021-05-10T12:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Failing to get currentPage in component that's locked...</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/457554#M131777</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;LI-USER uid="13133911"&gt;&lt;/LI-USER&gt;&amp;nbsp;, did you fix this? I'm having the same problem. I think it's related to those annotations. But I wasn't able to make it work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even this line doesn't work because current resource is in the template and the resultant currentPage will be structure of that template.&lt;/P&gt;&lt;PRE&gt;currentPage = request.getResourceResolver().adaptTo(PageManager.class).getContainingPage(resource);&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jun 2022 21:08:34 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-get-currentpage-in-component-that-s-locked-in-the/m-p/457554#M131777</guid>
      <dc:creator>GonzaloCalandria</dc:creator>
      <dc:date>2022-06-22T21:08:34Z</dc:date>
    </item>
  </channel>
</rss>

