We are trying to add a Region for our Global alerts site wide in Page Template.
Detailed implementation steps:
Initialize:
@RegisteredViewModel(viewName = "NWAlert", modelClass = RegionModelImpl.class),
@RegisteredViewModel(viewName = "AlertMessage", modelClass = AlertModel.class)
AlertRegion
:
<jsp:useBean id="region" type="com.sdl.webapp.common.api.model.RegionModel" scope="request"/>
<jsp:useBean id="markup" type="com.sdl.webapp.common.markup.Markup" scope="request"/>
<div ${markup.region(region)}>
<dxa:entities/>
</div>
Page.jsp
:
<dxa:region name="NWAlert" />
Workaround:
I can see the Alert
related data in Page Model data JSON response. Looks the content pre-rendered is happening properly.
When I do debug, I can see the Region of NWAlert
was properly initializing and it’s not throwing any error but still the Region part is not displaying in the Page.
[/WEB-INF/Views/xxx/Region/NWAlert.jsp]: Initialization successful
Also, I noticed when I do view source of my Page the Region tag is appending without data.
<div typeof="Region" resource="NWAlert">
<!-- Start Region: {title: "NWAlert", allowedComponentTypes: [{schema: "tcm:xx-xx-x", template: "tcm:xx-xx-xx"}], minOccurs: 0} -->
</div>