DynaForms included in another panel group dynamically

Community Driven Extensions Project
Post Reply
andrewtr
Posts: 2
Joined: 14 Oct 2014, 16:18

14 Oct 2014, 16:32

Hi;

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>
The forms which has been included using JSF is working fine also the standalone basic primefaces extension form is working fine. Whereas the primefaces ext form which I have included in "central_body_div" is not getting submitted. It is also not throwing any error. Below is the primefaces ext form page

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>
In update I am setting the "central_body_div" to include the page I have set as value in f:setPropertyActionListener.
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.

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests