myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zigc Junk" <zigcj...@gmail.com>
Subject Re: [Trinidad] Facelets + XHTML breaks Trinidad
Date Tue, 08 Apr 2008 14:34:47 GMT
I don't know why it does not work in your case. However, I can give
you an example that works. Try something like this.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html jsfc="trh:html"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:c="http://java.sun.com/jsp/jstl/core"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:tr="http://myfaces.apache.org/trinidad"
  xmlns:trh="http://myfaces.apache.org/trinidad/html">

  <head jsfc="trh:head">
    <ui:insert>
      <ui:include src="/WEB-INF/facelets/meta.xhtml" />
    </ui:insert>
    <ui:insert name="script">
      <ui:include src="/WEB-INF/facelets/js.xhtml" />
    </ui:insert>
  </head>

  <f:view>
    <body jsfc="trh:body" styleClass="t_doc">
      <tr:form id="rootForm">
        <ui:insert name="header">
          <ui:include src="/WEB-INF/facelets/header.xhtml" />
        </ui:insert>
        <ui:insert name="content">
          <ui:include src="/WEB-INF/facelets/content.xhtml" />
        </ui:insert>
        <ui:insert name="footer">
          <ui:include src="/WEB-INF/facelets/footer.xhtml" />
        </ui:insert>
      </tr:form>
    </body>
  </f:view>
</html>

regard

Bill

On Tue, Apr 8, 2008 at 5:05 AM, Maarten Dirkse
<Maarten.Dirkse@filterworks.com> wrote:
> Anyone else have any ideas?
> Regards,
> Maarten
>
> -----Original Message-----
> From: Maarten Dirkse [mailto:Maarten.Dirkse@filterworks.com]
> Sent: 4 april 2008 3:38
> To: MyFaces Discussion
> Subject: RE: [Trinidad] Facelets + XHTML breaks Trinidad
>
> Hi Mathias,
>
> I was using facelets without <f:view> tags like you said, until I needed
> them to produce XHTML. Simply setting the doctype declaration XHTML
> unfortunately doesn't seem to do anything in terms of forcing Trinidad
> to produce valid markup. As for using <tr:head> etc, I could definitely
> do that, but it still doesn't give me XHTML.
>
> Regards,
> Maarten
>
> PS. Like you, I've also got a layout template that defines all the
> doctype stuff, and then uses inserts for the pages. I just boiled the
> problem down to a single page for my question so as to make it as simple
> as possible to understand.
>
> -----Original Message-----
> From: Mathias Walter [mailto:mathias.walter@gmx.net]
> Sent: 3 april 2008 18:26
> To: 'MyFaces Discussion'
> Subject: RE: [Trinidad] Facelets + XHTML breaks Trinidad
>
> Hi Maarten,
>
> with Facelets you do not need <f:view>.
>
> Yesterday, I run into similar issues regarding to duplicate DOCTYPE
> tags.
> I solved it by declaring the DOCTYPE in my .xhtml layout file and avoid
> using <tr:document>. Instead, I'm using html, trh:head and trh:body
> inside my global layout template and using ui:composition inside all
> content files.
>
> I'm still porting my application to Facelets, but could solve the
> initial problems.
>
> --
> Regards,
> Mathias
>
> > -----Original Message-----
> > From: Maarten Dirkse [mailto:Maarten.Dirkse@filterworks.com]
> > Sent: Thursday, April 03, 2008 6:04 PM
> > To: users@myfaces.apache.org
> > Subject: [Trinidad] Facelets + XHTML breaks Trinidad
> >
> >
> > Hi,
> > I'm migrating an existing JSP project to use facelets, and ran into
> > the following issue:
> >
> > I discovered that the Trinidad renderkit doesn't producing valid XHTML
>
> > (at least when used with facelets). More specifically, it wasn't
> > closing tags like meta, input, link and a bunch of others, which led
> > to a list of warnings in my validator. (I was a little disappointed as
>
> > I believe that, for the sake of enforcing seperation of structure and
> > presentation, there's no good reason to default to anything but XHTML,
>
> > 1.0 strict or transitional.) I went hunting for a solution which I
> > found in a mail by Matthias who advised using the contentType
> > attribute on <f:view> (see
> > http://markmail.org/message/bu6g4s7momu6rifk).
> >
> > So I started using <f:view contentType="application/xhtml+xml">, the
> > mimetype for XHTML, which worked great until I tried to migrate a page
>
> > with actual buttons. They simply didn't work anymore. When I switched
> > the contentType back to "text/html" all the components worked again,
> > but I was stuck with the same invalid markup that I was trying to
> > avoid in the first place.
> >
> > Anyone have any ideas about how I can get valid XHTML markup *and*
> > working buttons? The guy who originally asked the question to which
> > Matthias responded apparently hit upon the same problem but doesn't
> > appear to have solved it either.
> >
> > Here's the markup that I used:
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> >   <html xmlns="http://www.w3.org/1999/xhtml"
> > xmlns:f="http://java.sun.com/jsf/core"
> > xmlns:tr="http://myfaces.apache.org/trinidad">
> >     <head>
> >       <title>Bla</title>
> >     </head>
> >
> >     <body>
> >     <f:view contentType="application/xhtml+xml">
> >       <tr:form defaultCommand="searchButton">
> >         <div id="searchbox">
> >           <tr:inputText value="#{searchBean.searchValue}"
> > simple="true"
> > />
> >           <tr:commandButton id="searchButton"
> > action="#{searchBean.searchNow}" text="Search" />
> >           <strong>#{searchBean.searchResult}</strong>
> >         </div>
> >       </tr:form>
> >     </f:view>
> >   </body>
> > </html>
> >
> > If I change '<f:view contentType="application/xhtml+xml">' to '<f:view
>
> > contentType="text/html">', the "Search" button stops working.
> > Any ideas?
> >
> > Regards,
> > Maarten
>
>

Mime
View raw message