How to add the REFRESH_PAGE for the component which holds parsys | Community
Skip to main content
June 6, 2017
Solved

How to add the REFRESH_PAGE for the component which holds parsys

  • June 6, 2017
  • 6 replies
  • 4885 views

Hi,

    I have a requirement in which a component (say A)is having only the parsys container and the component A is included in the template using <data-sly-resource>.

   Now when I drag/edit/delete the any component to component A parsys container the page is not refreshing and the component is not seen.

  The cq:editConfig.xml is as follows.

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"

    jcr:primaryType="cq:EditConfig">

    <cq:listeners

        jcr:primaryType="cq:EditListenersConfig"

        afterdelete="REFRESH_PAGE"

        afteredit="REFRESH_PAGE"

        afterinsert="REFRESH_PAGE"/>

</jcr:root>

I am using AEM 6.1 version. Please let me know if I am missing anything

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 VeenaVikraman

Hi Sruthi

          Why are you including a component which only have a parsys, in a template ? Can't you directly add a parsys to your template ? Is this a particular use case?

          For your query,

               The cq:listeners, listens to the event action of the component.

  • Lets say you dragged and dropped the component to the page, it will refresh (afterinsert).
  • You edited the dialog of the component or authored the component (afteredit) , it will refresh page.
  • You deleted the component, (afterdelete) , this will refresh the page.

     But since you are not directly editing this component A (you are indirectly adding other components to a parsys in this component A, which as per my understanding cannot be considered as an edit action for the component A . I would like smacdonald2008​ or Feike Visser​ to correct me if I am wrong ) , I assume this edit config listener added in Component A will not serve your purpose of refreshing the page as and when you drag and drop or edit a component.

     For that, you have to add this listeners to the components you will be dragging and dropping to this parsys.

PS:- I did try to replicate your scenario, tested it and could figure out the above points could be valid.

    Hope this helps you

Thanks

Veena  

6 replies

smacdonald2008
Level 10
June 6, 2017

What version of AEM are you using?

WHen you drag a new component into the page - what are you seeing exactly?

June 6, 2017

Hi Scott,

I am using AEM 6.1.

When I drag the component I am not seeing anything on the page

VeenaVikraman
Community Advisor
VeenaVikramanCommunity AdvisorAccepted solution
Community Advisor
June 6, 2017

Hi Sruthi

          Why are you including a component which only have a parsys, in a template ? Can't you directly add a parsys to your template ? Is this a particular use case?

          For your query,

               The cq:listeners, listens to the event action of the component.

  • Lets say you dragged and dropped the component to the page, it will refresh (afterinsert).
  • You edited the dialog of the component or authored the component (afteredit) , it will refresh page.
  • You deleted the component, (afterdelete) , this will refresh the page.

     But since you are not directly editing this component A (you are indirectly adding other components to a parsys in this component A, which as per my understanding cannot be considered as an edit action for the component A . I would like smacdonald2008​ or Feike Visser​ to correct me if I am wrong ) , I assume this edit config listener added in Component A will not serve your purpose of refreshing the page as and when you drag and drop or edit a component.

     For that, you have to add this listeners to the components you will be dragging and dropping to this parsys.

PS:- I did try to replicate your scenario, tested it and could figure out the above points could be valid.

    Hope this helps you

Thanks

Veena  

kautuk_sahni
Community Manager
Community Manager
June 7, 2017

+ with Veena_07

Why are we including a component which just have a parsys? Recommended way is to add parsys to the template.

But please have a look at this post:- How to refresh component through Javascript in Touch UI AEM/Adobe CQ5

// How to refresh component through Javascript in Touch UI

~kautuk

Kautuk Sahni
June 7, 2017

HI Veena/Kautuksahni,

   We have requirement to position the container right or left from the dialog value so we have created a separate component instead of adding parsys in the template.

kautuk_sahni
Community Manager
Community Manager
June 7, 2017
Kautuk Sahni