We might have come across or probably used
pega: reference jsp tag to refer properties in HTML rules like Fragment, Correspondence, Paragraph etc.
There could be a scenario where we have to refer a parameterized Datapage in a HTML rule. But the syntax to access or refer a Datapage with parameters doesn't work.
D_PageName[param1: value1, param2: value2].PropertyName
However, there is a workaround to refer properties from parameterized Datapages.
Note: It is not recommended to use this method. Better way is to construct a new Datapage or a normal page with all values and use as reference in HTML rule.
By setting the required parameters using java scriplet prior to using a reference tag, system will load the Datapage and the properties will be constructed in HTML rule.
<!-- Sample snippet to refer parameterized Datapages --> <% // Set all parameters required for datapage tools.putParamValue("OperatorId", "email@example.com"); // Set all other params required for datapage %> <div> <h1>Referencing Parameterized Data Page in HTML Rule</h1> <div> Name: <pega:reference name="D_pxOperatorDetails.pyUserName" /> </div> <div> Email: <pega:reference name="D_pxOperatorDetails.pyAddresses(Email).pyEmailAddress" /> </div> <div> TimeZone: <pega:reference name="D_pxOperatorDetails.pyDefaultTimeZone" /> </div> </div>
And the result looks like this
Hope this helps and be very careful to refer properties from parameterized Datapage using this method. This is not supported and there is no official documentation.
If there any questions, feel free to reach me.