0

I am struggling to figure out a way to include dynamically determined pages in run-time in a JSPX and Trinidad project. You will have an idea when you see what I have, which is:

<tr:panelAccordion>

<tr:showDetailItem
    text="Test tab">
    <jsp:include page=".test.jspx" /> <!-- This part is working fine -->
</tr:showDetailItem>

<jsp:scriptlet>
    BackingTest backing = (BackingTest) session.getAttribute("backingTest");
    for (CaseTabConfigurationDTO tab : backing.getTabs()) {

        java.io.File f = new java.io.File(request.getRealPath(tab.getPagePath()));
        if (f.exists()) {
            pageContext.include(tab.getPagePath(), true);
        }
    }
</jsp:scriptlet>
</tr:panelAccordion>

jsp:include part is working fine, nothing is breaking the JSF lifecycle.

jsp:scriplet part is successful for including the correct pages. However, it is breaking the later actions in JSF lifecycle including still persisting backing beans of dialogs opened using useWindow="true".

In order to be make it complaint with Facelet, thus not breaking JSF lifecycle. I tried using tr:forEach, c:forEach, ui:include, ui:repeat approaches without any luck of actually including pages.

Can you share a proper solution for it? Thanks in advance!

Dagvadorj
  • 298
  • 4
  • 14

1 Answers1

1

You probably want to reconfigure your project so you can use Facelets with Trinidad. After reconfiguring your project can use Facelets for templating. You will end up using xhtml instead of jspx though.

See also:

Community
  • 1
  • 1
Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102