[JSMODELS-23] Parent model shall be available to JS Model script Created: 30/Aug/19  Updated: 28/Mar/22

Status: Open
Project: Magnolia Javascript Models
Component/s: None
Affects Version/s: 1.1.1
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Andrey Zavodnik Assignee: Jaroslav Simak
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

When Java model is executed, it receives containing component's model instance.

This is essential for pages that have collaborating elements: e.g. blog post page would load pot content and add post's name to <title> element.

But post details rendering is performed by a nested content element, which would assume it is positioned in a Blog Post page and take content data from Page's model.

But in JS Model "parent" parameter is not available.

JavascriptRenderingModel constructor receives RenderingModel<?> parent parameter, but doesn't pass it to JS engine.


Generated at Mon Feb 12 05:58:53 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.