RichFaces a4j:include does not work.
chamika Jul 3, 2008 2:35 PMHi
I'm new to rich faces and a4j. And I trying to use it in my jsf project in netbeans. There I have tried the exact same example taken from this link.
http://livedemo.exadel.com/richfaces-demo/richfaces/include.jsf?c=include
There I include xhtml file to my jsp page like this.
<h:panelGrid width="100%" columns="2" columnClasses="col1,col2"> <a4j:keepAlive beanName="profile" /> <rich:panel styleClass="wizard"> <f:facet name="header"> <h:outputText value="Using a4j:include for Wizard-like behaviour" /> </f:facet> <h:form> <a4j:include viewId="wstep1.xhtml" /> </h:form> </rich:panel> </h:panelGrid>
But when run the project, nothing display. When i view the source in browser it nicely show the exact whole code in xhtml file. Means that nothing rendered, just included as text.
Please help me out to solve this problem. I have stucked with this whole 2 days.
-----------Here I'm including my source codes-----------------
--JSP page--
<?xml version="1.0" encoding="UTF-8"?> <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/> <f:view> <webuijsf:page id="page1"> <webuijsf:html id="html1"> <webuijsf:head id="head1"> <webuijsf:link id="link1" url="/resources/stylesheet.css"/> </webuijsf:head> <webuijsf:body id="body1" style="-rave-layout: grid"> <h:panelGrid width="100%" columns="2" columnClasses="col1,col2"> <a4j:keepAlive beanName="profile" /> <rich:panel styleClass="wizard"> <f:facet name="header"> <h:outputText value="Using a4j:include for Wizard-like behaviour" /> </f:facet> <h:form> <a4j:include viewId="wstep1.xhtml" /> </h:form> </rich:panel> </h:panelGrid> </webuijsf:body> </webuijsf:html> </webuijsf:page> </f:view> </jsp:root>
--xhtml---
<?xml version="1.0" encoding="UTF-8"?> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <div style="position:relative;height:140px"> <h:panelGrid style="padding: 15px" rowClasses="s1row" columns="3" columnClasses="wfcol1,wfcol2,wfcol3"> <h:outputText value="First Name:" /> <h:inputText id="fn" value="#{profile.firstName}" label="First Name" required="true" /> <rich:message for="fn" /> <h:outputText value="Last Name:" /> <h:inputText id="ln" value="#{profile.lastName}" label="Last Name" required="true" /> <rich:message for="ln" /> <h:outputText value="Company:" /> <h:inputText id="comp" value="#{profile.company}" label="Company" required="true" /> <rich:message for="comp"/> </h:panelGrid> <div> <a4j:commandButton style="float:right" action="next" value="Next >>"/> </div> </div> </ui:composition>
--faces config--
<managed-bean> <managed-bean-name>profile</managed-bean-name> <managed-bean-class>com.chamika.profile</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <navigation-rule> <from-view-id>wstep1.xhtml</from-view-id> <navigation-case> <from-outcome>next</from-outcome> <to-view-id>wstep2.xhtml</to-view-id> </navigation-case> </navigation-rule>
--bean---
the profile bean also there with getters and setters.
Please help me out!