Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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

magns
Level 1
Level 1

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.

   window.parent.postMessage(

   JSON.stringify({

   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.

0 Replies