如何在 AEM6.1 中从侧面板拖动组件时刷新页面?
How to refresh page while dragging component from side panel in AEM6.1?
我需要在作者将组件从侧面板拖动到 parsys 时刷新页面。该组件仅在页面刷新后显示编辑工具栏。这只是触摸 ui 中的问题,因为经典的 editConfig 始终在页面上显示编辑栏。如何在作者从侧面板拖动组件时偷偷刷新页面?
经过一些调查,我发现这里是有效的。
- cq:editConfigs 和 cq:EditListenersConfig 不适用于触摸 ui。即使在添加 afterInsert="REFRESH_PAGE" 之后,页面刷新也不会发生。
触摸ui发生拖放动作时执行的java脚本是:
/libs/cq/gui/components/authoring/clientlibs/editor/js/edit/edit.actions.js
所以我创建了一个叠加层,基本上将 js 复制到我的应用程序客户端库中并在 self.doInsert() 函数中添加以下条件:
self.doInsert = function (component, insertBehavior, editableNeighbor, historyConfig, additionalData) {
if(component.componentConfig.path == '/apps/sample/components/media/rich-media' || component.componentConfig.path == '/apps/sample/components/media/tiled-display')
{ window.location.reload(); }
现在作者拖动组件后页面正在刷新。
请告诉我这是否可行以及为什么 cq:EditListenersConfig 无法联系 ui。
我需要在作者将组件从侧面板拖动到 parsys 时刷新页面。该组件仅在页面刷新后显示编辑工具栏。这只是触摸 ui 中的问题,因为经典的 editConfig 始终在页面上显示编辑栏。如何在作者从侧面板拖动组件时偷偷刷新页面?
经过一些调查,我发现这里是有效的。
- cq:editConfigs 和 cq:EditListenersConfig 不适用于触摸 ui。即使在添加 afterInsert="REFRESH_PAGE" 之后,页面刷新也不会发生。
触摸ui发生拖放动作时执行的java脚本是:
/libs/cq/gui/components/authoring/clientlibs/editor/js/edit/edit.actions.js
所以我创建了一个叠加层,基本上将 js 复制到我的应用程序客户端库中并在 self.doInsert() 函数中添加以下条件:
self.doInsert = function (component, insertBehavior, editableNeighbor, historyConfig, additionalData) { if(component.componentConfig.path == '/apps/sample/components/media/rich-media' || component.componentConfig.path == '/apps/sample/components/media/tiled-display') { window.location.reload(); }
现在作者拖动组件后页面正在刷新。
请告诉我这是否可行以及为什么 cq:EditListenersConfig 无法联系 ui。