In layout.xhtml I am including the xhtml files in "central_body_div" to reflect the body content based on the URL dynamically.
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<h:head>
<meta charset="ISO-8859-1" />
<title>Compvue Website Builder</title>
<h:outputStylesheet library="css" name="style.css" />
</h:head>
<h:body>
<div class="header">
<ui:insert name="header" >
<ui:include src="/WEB-INF/include/header.xhtml" />
</ui:insert>
<ui:insert name="menu" >
<ui:include src="/WEB-INF/include/menu.xhtml" />
</ui:insert>
</div>
<div class="content">
<h:panelGroup id="central_body_div">
<ui:include src="#{templateBean.page}.xhtml" />
</h:panelGroup>
</div>
</h:body>
</html>
Code: Select all
<!DOCTYPE html>
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions">
<ui:composition>
<h:form id="mainForm">
<h:panelGroup id="dynaFormGroup">
<p:messages id="messages" showSummary="true" autoUpdate="true"/>
<pe:dynaForm id="dynaForm" value="#{contentTypePageBean.model}" var="data">
<pe:dynaFormControl type="input" for="txt">
<p:inputText id="txt" value="#{data.value}" required="#{data.required}"/>
</pe:dynaFormControl>
<pe:dynaFormControl type="calendar" for="cal" styleClass="calendar">
<p:calendar id="cal" value="#{data.value}" required="#{data.required}" showOn="button"/>
</pe:dynaFormControl>
<pe:dynaFormControl type="select" for="sel" styleClass="select">
<p:selectOneMenu id="sel" value="#{data.value}" required="#{data.required}">
<f:selectItems value="#{contentTypePageBean.languages}"/>
</p:selectOneMenu>
</pe:dynaFormControl>
<pe:dynaFormControl type="textarea" for="tarea">
<p:inputTextarea id="tarea" value="#{data.value}" required="#{data.required}" autoResize="false"/>
</pe:dynaFormControl>
<pe:dynaFormControl type="rating" for="rat">
<p:rating id="rat" value="#{data.value}" required="#{data.required}"/>
</pe:dynaFormControl>
<f:facet name="buttonBar">
<p:commandButton value="Save" action="#{contentTypePageBean.submitForm}" update=":central_body_div" process="dynaForm">
<f:setPropertyActionListener target="#{templateBean.page}" value="/WEB-INF/pages/contentType/addContentPage" />
</p:commandButton>
<p:commandButton type="reset" value="Reset" style="margin-left: 5px;"/>
</f:facet>
</pe:dynaForm>
</h:panelGroup>
</h:form>
</ui:composition>
</html>
Neither the page is been called nor it is been submitted. It is taking the default page of {templateBean.page}. Kindly let me know how to rectify this problem.