这就是我面临的问题,我有非常简单的组件A和B,A在组件B内部使用一个数据灵巧的资源
我可以编辑组件A,但是如果我想看到我的更改被应用,我需要手动刷新页面或编辑组件B。
我尝试添加cq:listener,但没有成功
<cq:listeners
jcr:primaryType="cq:EditListenersConfig"
afteredit="REFRESH_PAGE"
/>下面是我的A组件的.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"/>下面是组件A的cq: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"
cq:dialogMode="floating"
jcr:primaryType="cq:EditConfig">
<cq:listeners
jcr:primaryType="cq:EditListenersConfig"
afteredit="REFRESH_PAGE"/>
</jcr:root>我使用的是AEM 6.2。
有谁能帮上忙吗?
谢谢
发布于 2017-06-01 21:42:45
在组件A(我认为是内部组件)的cq: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时刷新。我正在将此方法用于自定义布局/网格组件。
https://stackoverflow.com/questions/43633157
复制相似问题