2017-04-26 83 views
0

这是我面临的问题,我有很简单的A和B组,使用一个数据狡猾资源嵌套组件刷新编辑后

我可以编辑用于内部成分B 的组件A,但我需要手动刷新页面或编辑组件B,如果我想查看我应用的更改。

我尝试添加了CQ:监听器,但没有运气

<cq:listeners 
    jcr:primaryType="cq:EditListenersConfig" 
    afteredit="REFRESH_PAGE" 
/> 

这是我的一个组件.content.xml:

<?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:description="component A" 
    jcr:primaryType="cq:Component" 
    jcr:title="Component A" 
    allowedParents="[ */*parsys]" 
    componentGroup="testComponent"/> 

这是我对于B .content.xml成分:

<?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:Component" 
      jcr:title="Component" 
      componentGroup="testComponent"/> 

这里是CQ:组分A

的editConfig 0
<?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" 
    cq:dialogMode="floating" 
    jcr:primaryType="cq:EditConfig"> 
    <cq:listeners 
     jcr:primaryType="cq:EditListenersConfig" 
     afteredit="REFRESH_PAGE"/> 
</jcr:root> 

我正在使用AEM 6.2。

任何人可以帮助这个吗?

由于

+0

这很奇怪,因为你的'cq:listeners'似乎没问题。如果您向我们提供更多信息,它可能会有帮助这两个组件的'.content.xml'文件的外观如何?组件'B'具体定义为一个容器组件?你可以发布你的整个'cq:editConfig'吗? – Jens

+0

组件B未被定义为容器,我该怎么做?感谢您的回答 – Seb

+0

您必须在组件B中添加'cq:isContainer =“{Boolean} true”'我不知道这是否真的有帮助,但它可能是缺少的东西:) – Jens

回答

0

在CQ:组分A editConfig节点(我理解是该内部部件),你尝试:

<?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" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 
    jcr:primaryType="cq:EditConfig"> 
    <cq:listeners 
    jcr:primaryType="cq:EditListenersConfig" 
    afteredit="REFRESH_PARENT"/> 
</jcr:root> 

这将迫使母体组分B时刷新编辑组件A.我使用这种方法来定制布局/网格组件。