6.4.5 Dynamic template editor does not work when cq:datatype is JSON



The context switching (structure/edit/..) does not work and editables does not show up because core.js waits for a "cq-pagemodel-loaded" event.

The latest @adobe/cq-spa-page-model-manager (1.0.7) npm library submit this event after it fetches the page model but it is not received by the listener in core.js, I believe it is because it submits the event on the wrong window object.

Doing a manual submit fixed the problem in our case, so i'm posting this as a workaround for those who experience it.



   data: {

   model: this.state.pageModel


   type: 'request',

   group: 'cqauthor',

   msg: 'cq-pagemodel-loaded'

  }), "*");

We don't use cq-spa-page-model-manager but when experiencing the problem I tested it and found that it had this issue.