I tried to alternate pages using ui:include
on click of ajax (PrimeFaces) treenodes. The first page that load by default loads properly with all the components active but when I click on the other treenode to display another page, the latter page loads abnormally like having the dialog box visible below and the page hands.
I feel if I can force the page to reload partially as default on nodeSelect
index.jsf
(gets loaded on login)
<p:layoutUnit position="west" size="270" header="Menu" collapsible="false" resizable="true">
<p:ajaxStatus style="width:16px;height:16px;">
<f:facet name="start">
<h:graphicImage value="../design/ajaxloading.gif"/>
</f:facet>
<f:facet name="complete">
<h:outputText value=""/>
</f:facet>
</p:ajaxStatus>
<h:form id="appsMainControl">
<ui:include src="/ui/appServices.jsf"/>
</h:form>
</p:layoutUnit>
<p:layoutUnit position="center">
<h:form id="centerControl">
<ui:include src="/ui/#{amb.appToGet}.jsf"/>
</h:form>
</p:layoutUnit>
The treeview component with the listener action. On node selection I want the child page to load appropriately
<p:layoutUnit position="west" size="270" header="Menu" collapsible="false" resizable="true">
<p:ajaxStatus style="width:16px;height:16px;">
<f:facet name="start">
<h:graphicImage value="../design/ajaxloading.gif"/>
</f:facet>
<f:facet name="complete">
<h:outputText value=""/>
</f:facet>
</p:ajaxStatus>
<h:form id="appsMainControl">
<ui:include src="/ui/appServices.jsf"/>
</h:form>
</p:layoutUnit>
<p:layoutUnit position="center">
<h:form id="centerControl">
<ui:include src="/ui/#{amb.appToGet}.jsf"/>
</h:form>
</p:layoutUnit>
The backing bean:
public void onNodeSelect(NodeSelectEvent event) throws Exception {
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
try {
appToGet = appsMainDAO.appToGet(event.getTreeNode().toString());
// ec.redirect("index.jsf");
// System.out.println("Got "+appToGet);
// appSubList = appsMainDAO.appsSubServicesList(appToGet, "Forms");
} catch (Exception ex) {
ex.printStackTrace();
Logger.getLogger(appsMainBean.class.getName()).log(Level.SEVERE, null, ex);
} finally {
}
}