Saravana Prakash
Saravana Prakash

Reputation: 1323

How to refresh page while dragging component from side panel in AEM6.1?

My need is to refresh the page when author drags component from side panel onto parsys. The component displays the edit tool bar only after page refresh. This is problem only in touch ui since classic editConfig displays edit bar always on the page. How do I sneak a page refresh action when author drags component from side panel?

Upvotes: 2

Views: 2640

Answers (1)

Saravana Prakash
Saravana Prakash

Reputation: 1323

After some investigation here is what I found and it works.

  • cq:editConfigs and cq:EditListenersConfig are not working for touch ui. Even after adding afterInsert="REFRESH_PAGE", the page refresh doesn't happen.
  • The java script that is executed when drag&drop action happens in touch ui is:

    /libs/cq/gui/components/authoring/clientlibs/editor/js/edit/edit.actions.js
    
  • So I created an overlay, basically copied the js into my application client libraries and added below condition in self.doInsert() function:

      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(); }
    
  • Now page is refreshing after author drags the component.

Please let me know if this is advisable way and why cq:EditListenersConfig is not working in touch ui.

Upvotes: 2

Related Questions