Subscribe to Master Page Model events from Child Page

  • 4
  • Idea
  • Updated 2 years ago
  • Under Consideration
  • (Edited)
On a child page, would like to be able to "subscribe" to events on models that are defined in the master page.  

This can be accomplished programmatically but you lose the ability of the page composer and action framework.

Thanks!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 3 years ago

  • 4
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Can you explain a little more what you mean? I can think of a couple ways to implement this:
(a) Allow adding Model Actions to Master Page Models from a Child Page. These Model Actions would only be run from a particular child page.
(b) Add a Page-level Actions area (would be nice to have regardless of the Master/Child page scenario) where you could subscribe to events on one or more Models in the Child Page or the Master Page.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Barry, can you flesh this out?  Models in a master page are made available to all child pages,  so you can do things like retrieve data, set conditions, etc on the child page's models and features based on master page model data.  What do you mean by "subscribe"? 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I imagined this as the ability to add a page-specific model action to a model on the master page... as it currently stands, we can't change the model definition of the master page models on child pages (which is as it should be... except potentially in the case of adding child-page-specific model actions).
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Hi All - 

Happy to provide more details.  I guess it really comes down to how far to take this concept.  In my OP I was thinking simple to start with but I could really see this getting pretty slick and include things like extra fields even (this would be more difficult depending on how the XML is parsed for model definitions).

Initially I was thinking that a page designer, from a child page, could choose a master model, go to "actions" and subscribe to its events.  In the XML, it could be a separate node under models (e.g. <parentmodels>) with a models tagand then normal processing would occur on the actions node.  For example, I have a "RunningUser" model on my master page so on my child page, I could subscribe to the "row created" event and take child page specific actions without having to add another "RunningUserChild" model or using javascript.

Zach - I'm not seeing the "Page Level Actions" idea that you mentioned - can you explain that one?  For subscribing to child page models, you could just use the model on the child page itself, not sure you'd need an extra "Page-Level Actions" area for the child models themselves?
Photo of mB Andréas K.LeF

mB Andréas K.LeF

  • 1,244 Points 1k badge 2x thumb
Updates on this one? Bump?