Adobe CQ / AEM - 触发afteredit处理程序 [英] Adobe CQ/AEM - trigger afteredit handler
问题描述
当我在组件编辑器对话框中选择确定时,组件会自行重绘,假设我已经设置了_cq_editConfig.xml:
When I select "OK" in a component editor dialog, the component redraws itself, assuming I've got the _cq_editConfig.xml set up:
<cq:listeners
jcr:primaryType="cq:EditListenersConfig"
afteredit="REFRESH_SELF"/>
我想做的是通过javascript触发afteredit。我有一个情况,内容已经改变,作者应该有渲染组件的更新视图,但我不知道如何做到这一点,重新加载整个页面或打开和关闭编辑对话框。据推测,可以调用由REFRESH_SELF常量表示的函数,但我不知道如何将常量跟踪回函数。
What I'd like to do is trigger "afteredit" via javascript. I've got a situation where the content has been changed and the author should have an updated view of the rendered component, but I don't know how to do this short of reloading the entire page or opening and closing the edit dialog. Presumably, the function that is represented by the "REFRESH_SELF" constant could be called, but I don't know how to trace the constant back to the function.
有谁知道如何从javascript触发afteredit?
Does anyone know how to trigger afteredit from javascript?
推荐答案
REFRESH_SELF常量映射到方法CQ.wcm.EditBase.refreshSelf。您可以使用crxde转至/libs/cq/ui/widgets/source/widgets/wcm/EditBase.Listeners.js找到它的定义。要通过javascript触发它,首先需要具有可编辑对象,然后调用该方法。例如:
the REFRESH_SELF constant is mapped to the method CQ.wcm.EditBase.refreshSelf. You can find its definition by going to /libs/cq/ui/widgets/source/widgets/wcm/EditBase.Listeners.js using crxde. To trigger it by javascript you need first to have the editable object and then call the method. For example:
var ed = CQ.WCM.getEditable('/path/to/the/object/in/page');
ed.refreshSelf();
这篇关于Adobe CQ / AEM - 触发afteredit处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!