Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Comm-Dev-101 Exam - Topic 3 Question 3 Discussion

A developer is tasked with the development of a new Page Designer Page Type, as requested by the merchant. How should they define the rendering logic of the page?
A) Implement a JavaScript file with a render() function.
B) Implement a metadata JSON file with a 'render' property.
C) Implement a Controller file with a 'render' route.

Salesforce Comm-Dev-101 Exam - Topic 3 Question 3 Discussion

Actual exam question for Salesforce's Comm-Dev-101 exam
Question #: 3
Topic #: 3
[All Comm-Dev-101 Questions]

A developer is tasked with the development of a new Page Designer Page Type, as requested by the merchant. How should they define the rendering logic of the page?

Show Suggested Answer Hide Answer
Suggested Answer: A

A Page Designer Page Type consists of a metadata definition plus a corresponding JavaScript implementation. The rendering behavior itself belongs in the page-typeJavaScript file, which must expose arender()function.

Salesforce states that the script file must have the same base name and location as the Page Designer meta-definition file, using.jsrather than.json. The script'srenderfunction receives aPageScriptContextand must return the resulting markup as a string. It commonly renders an ISML template usingdw.util.Template, and the template can in turn render the page's regions.

The metadata JSON describes the Page Type's declarative configuration---such as its attributes and regions---but does not implement rendering through a'render'property. A conventional SFRA controller route can invokePageMgr.renderPage()to initiate rendering, but that controller does not define the actual Page Type rendering logic.

This separation allows Page Designer to manage page composition while the JavaScript implementation controls the output representation.

Study Guide reference:Application Development --- Page Designer Page Types, page metadata,render()functions,PageScriptContext, and Page Designer rendering.

===============


Contribute your Thoughts:

0/2000 characters

Currently there are no comments in this discussion, be the first to comment!


Save Cancel