Richfaces + Facelets
ilya80 Jan 23, 2008 9:11 AMCalling for advice here.
I`m trying to add facelets to richfaces-enabled application, and cant get it to work right.
I added the following to the web.xml:
<context-param> <param-name>facelets.REFRESH_PERIOD</param-name> <param-value>2</param-value> </context-param> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name> <param-value>com.sun.facelets.FaceletViewHandler</param-value> </context-param>
when i add
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
to my application definition in faces-config.xml and put the 1.1.13 jsf-facelets.jar to my libs, everything breaks and things just stop working for me.
if i do not though, templates are working but in a wrong way.
suppose i have a aj4:include that inserts "current page" portion into my main panel. When i replace my working .jspx with one that uses template following can be observed.
1) text outside of <ui:composition>...</ui:composition> gets rendered.
2) templated portion of mainpanel gets rendered every other try.
3) templated portion of mainpanel gets its layout messed up, like:
<template.jspx>
... <h:panelGrid columns="2" style="width: 100%;" styleClass="main" columnClasses="commonCell"> <ui:insert name="part1">Default text</ui:insert> <ui:insert name="part2">Default text</ui:insert> </h:panelGrid> ...
<page.jspx>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:rich="http://richfaces.org/rich"> <ui:composition template="/res/xhtml/template.jspx"> <ui:define name="part1"> .... </ui:define> <ui:define name="part2"> .... </ui:define> </ui:composition> </jsp:root>
part2 is rendered below part1, and not next to it (as it correctly does in non-templated version of .jspx)
Any comments, please?