Expand my Community achievements bar.

SOLVED

How to add the REFRESH_PAGE for the component which holds parsys

Avatar

Level 1

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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  

View solution in original post

6 Replies

Avatar

Level 10

What version of AEM are you using?

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

Avatar

Level 1

Hi Scott,

I am using AEM 6.1.

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

Avatar

Correct answer by
Community Advisor

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  

Avatar

Administrator

+ 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

Avatar

Level 1

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.