On 9/6/07, Chris Pratt <[EMAIL PROTECTED]> wrote:
> On 9/6/07, Ray Clough <[EMAIL PROTECTED]> wrote:
> > Are you remembering to set flush=false, and include everything in a
> > subview, which we do like this in our 'template.jspx" file:
> >
> > <f:subview id="menu">
> > <tiles:insertAttribute name="menu" flush="false" />
> > </f:subview>
> >
> > - Ray Clough
> >
> >
> >
> Yup, the layout.jsp is basically:
>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <f:view>
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
> <head>
> <title><tiles:insertAttribute name="title"/></title>
> </head>
> <body>
> <tiles:insertAttribute name="body" flush="false" ignore="true"/>
> </body>
> </html>
> </f:view>
>
> And I'm not creating a sub-view since the included body is a simple <p> tag.
>
> But I'm not sure you've seen my latest post, It seemed to have
> something to do with the relative reference generated in the
> dispatchToTile method in the ViewHandler. Thanks for all your help.
> (*Chris*)
>
Well, it looks like going forward there are still problems to solve.
My tiles definition looks like this:
<definition name="index" template="/layout/layout.jsf">
<put-attribute name="title" value="Crash Test Dummy" type="string"/>
<put-attribute name="body" value="/body/body.jsp" type="template"/>
</definition>
/layout/layout.jsp contains the main <f:view> that encompasses all the
tiles inserts.
/body/body.jsp contains an <f:subview> and a <h:form> containing a few
controls. But when the form gets generated it has the wrong action!
The generated form comes out like:
<form id="body:_idJsp0" name="body:_idJsp0" method="post"
action="/crash/layout/layout.jsf"
enctype="application/x-www-form-urlencoded">
Notice that the action is getting set to the name of the main layout
template, not back to something that JSF can properly route.
Has anyone been able to get Tiles and JSF working together properly?
Any help would be massively appreciated.
(*Chris*)