You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Gus <sh...@gmail.com> on 2006/08/10 19:50:19 UTC
Problem with myfaces/facelets template.xhtml
Hi everyone,
I just begin to learn Facelets and Myfaces. I created a template, but the
template did display as expected. The "sidebar" and "content" should be
displayed in two columns as left and right, but it always display in one
columns as up and down. I really do not have any idea how to fix it. Any
help will be apprieciated. Thank you in advance.
Gus
============= Template.xhtml ==================
<t:document 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:t="http://myfaces.apache.org/tomahawk"
xmlns:http="http://www.disy.de/commons/facelets/tag/http">
<f:view>
<t:documentHead>
<title>Global Documents</title>
<t:stylesheet path="styles.css"/>
<!-- include file="/template/_jscript.js" -->
<!--@ include file="/template/AjaxRequest.js" -->
</script>
</t:documentHead>
<t:documentBody>
<h:panelGrid columns="1" styleClass="mainBody" rowClasses="row"
cellspacing="0" cellpadding="0" border="1">
<!-- header insert -->
<f:facet name="header">
<h:form id="menuForm">
<ui:include src="header.xhtml"/>
</h:form>
</f:facet>
<!-- body insert -->
<h:panelGrid columns="2" border="0"
styleClass="contentBody"
columnClasses="sidemenu, content"
cellspacing="1" cellpadding="0">
<!-- submenu of side bar insert -->
<h:form id="sidemenuForm">
<ui:insert name="sidebar"/>
</h:form>
<!-- content insert -->
<h:form id="contentForm" enctype="multipart/form-data">
<ui:insert name="content"/>
</h:form>
</h:panelGrid>
<!-- footer insert -->
<f:facet name="footer">
<ui:include src="footer.xhtml"/>
</f:facet>
</h:panelGrid>
</t:documentBody>
</f:view>
</t:document>
--
View this message in context: http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138.html#a5749229
Sent from the MyFaces - Users forum at Nabble.com.
RE: Problem with myfaces/facelets template.xhtml
Posted by Gus <sh...@gmail.com>.
David,
The sidebar and content should be in two columns(left and right), but they
were displayed in one column (top and down). I did not review the rendered
html code. I will send it you later. Thank you.
Best wishes!
Gus.
David Friedman-2 wrote:
>
> Right, but what did you get over in your browser? Knowing what came out
> in
> the wrong places in the browser helps you figure out what parts of the
> .xhtml page are acting incorrectly. THEN we can act/work on those items.
>
> Regards,
> David
>
> -----Original Message-----
> From: Gus [mailto:sheng.gu@gmail.com]
> Sent: Thursday, August 10, 2006 4:54 PM
> To: users@myfaces.apache.org
> Subject: RE: Problem with myfaces/facelets template.xhtml
>
>
>
> Hi David,
> The template I want is
> <table>
> <tr><td colspan=2>header</td></tr>
> <tr><td>sidemenu</td> <td>content</td></tr>
> <tr><td colspan=2>footer</td><tr>
> </table>
> in jsf:
> <h:panelGrid columns="2">
> <f:facet name=header>
> header
> </f:facet>
> <h:panelGrid>sidebar</h:panelGrid>
> <h:panelGrid>content</h:panelGrid>
> <f:facet name="footer">
> footer
> </f:facet>
> I ever used the template in myface/tiles, and it displayed fine. However,
> when I transfer the codes to facelets, it did not display well. I do not
> know why. Thank you for help.
>
> Best regards,
>
> Gus
>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138.html#a5753030
Sent from the MyFaces - Users forum at Nabble.com.
Re: Problem with myfaces/facelets template.xhtml
Posted by Gus <sh...@gmail.com>.
Hi Mike,
Thank you very much for your help on this thread. In fact, I noticed the
commend issue when I read facelets document, but I misunderstood that the
comment is about commenting some tags, e.g. <!-- <h:commandLink>..., I did
not realize it covers all comments.
Regards,
Gus.
Mike Kienenberger wrote:
>
> On 8/10/06, Gus <sh...@gmail.com> wrote:
>> It seems I found the problem. After I moved the several comments in the
>> template.html, it displays correctly. Modified codes is as follows:
>
> Hey Gus. Yes, that's right, now that you point it out.
>
> Text (even if it is comments) is internally treated by facelets (and
> also JSF 1.2) as a "literal text component".
>
> So each block of text occupies a space in your panelGrid, giving you
> the following output.
>
> comment menu
> comment page
>
> One thing you can do is tell facelets to skip all comments (they won't
> be in your final generated html, el expressions in them won't be
> evaluated, and they won't be treated as components).
>
>
--
View this message in context: http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138.html#a5790487
Sent from the MyFaces - Users forum at Nabble.com.
Re: Problem with myfaces/facelets template.xhtml
Posted by Mike Kienenberger <mk...@gmail.com>.
On 8/10/06, Gus <sh...@gmail.com> wrote:
> It seems I found the problem. After I moved the several comments in the
> template.html, it displays correctly. Modified codes is as follows:
Hey Gus. Yes, that's right, now that you point it out.
Text (even if it is comments) is internally treated by facelets (and
also JSF 1.2) as a "literal text component".
So each block of text occupies a space in your panelGrid, giving you
the following output.
comment menu
comment page
One thing you can do is tell facelets to skip all comments (they won't
be in your final generated html, el expressions in them won't be
evaluated, and they won't be treated as components).
RE: Problem with myfaces/facelets template.xhtml
Posted by Gus <sh...@gmail.com>.
Hi David,
It seems I found the problem. After I moved the several comments in the
template.html, it displays correctly. Modified codes is as follows:
<h:panelGrid columns="1" styleClass="mainBody" rowClasses="row"
cellspacing="0" cellpadding="0" border="1">
<f:facet name="header">
<ui:include src="header.xhtml"/>
</f:facet>
<h:panelGrid columns="2" border="0"
styleClass="contentBody"
columnClasses="sidemenu, content"
cellspacing="1" cellpadding="0">
<ui:insert name="sidebar"/>
<ui:insert name="content"/>
</h:panelGrid>
<f:facet name="footer">
<ui:include src="footer.xhtml"/>
</f:facet>
</h:panelGrid>
Thank you so much for your help.
Best regards,
Gus
David Friedman-2 wrote:
>
> Right, but what did you get over in your browser? Knowing what came out
> in
> the wrong places in the browser helps you figure out what parts of the
> .xhtml page are acting incorrectly. THEN we can act/work on those items.
>
> Regards,
> David
>
> -----Original Message-----
> From: Gus [mailto:sheng.gu@gmail.com]
> Sent: Thursday, August 10, 2006 4:54 PM
> To: users@myfaces.apache.org
> Subject: RE: Problem with myfaces/facelets template.xhtml
>
>
>
> Hi David,
> The template I want is
> <table>
> <tr><td colspan=2>header</td></tr>
> <tr><td>sidemenu</td> <td>content</td></tr>
> <tr><td colspan=2>footer</td><tr>
> </table>
> in jsf:
> <h:panelGrid columns="2">
> <f:facet name=header>
> header
> </f:facet>
> <h:panelGrid>sidebar</h:panelGrid>
> <h:panelGrid>content</h:panelGrid>
> <f:facet name="footer">
> footer
> </f:facet>
> I ever used the template in myface/tiles, and it displayed fine. However,
> when I transfer the codes to facelets, it did not display well. I do not
> know why. Thank you for help.
>
> Best regards,
>
> Gus
>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138.html#a5754667
Sent from the MyFaces - Users forum at Nabble.com.
RE: Problem with myfaces/facelets template.xhtml
Posted by David Friedman <hu...@ix.netcom.com>.
Right, but what did you get over in your browser? Knowing what came out in
the wrong places in the browser helps you figure out what parts of the
.xhtml page are acting incorrectly. THEN we can act/work on those items.
Regards,
David
-----Original Message-----
From: Gus [mailto:sheng.gu@gmail.com]
Sent: Thursday, August 10, 2006 4:54 PM
To: users@myfaces.apache.org
Subject: RE: Problem with myfaces/facelets template.xhtml
Hi David,
The template I want is
<table>
<tr><td colspan=2>header</td></tr>
<tr><td>sidemenu</td> <td>content</td></tr>
<tr><td colspan=2>footer</td><tr>
</table>
in jsf:
<h:panelGrid columns="2">
<f:facet name=header>
header
</f:facet>
<h:panelGrid>sidebar</h:panelGrid>
<h:panelGrid>content</h:panelGrid>
<f:facet name="footer">
footer
</f:facet>
I ever used the template in myface/tiles, and it displayed fine. However,
when I transfer the codes to facelets, it did not display well. I do not
know why. Thank you for help.
Best regards,
Gus
RE: Problem with myfaces/facelets template.xhtml
Posted by Gus <sh...@gmail.com>.
Hi David,
The template I want is
<table>
<tr><td colspan=2>header</td></tr>
<tr><td>sidemenu</td> <td>content</td></tr>
<tr><td colspan=2>footer</td><tr>
</table>
in jsf:
<h:panelGrid columns="2">
<f:facet name=header>
header
</f:facet>
<h:panelGrid>sidebar</h:panelGrid>
<h:panelGrid>content</h:panelGrid>
<f:facet name="footer">
footer
</f:facet>
I ever used the template in myface/tiles, and it displayed fine. However,
when I transfer the codes to facelets, it did not display well. I do not
know why. Thank you for help.
Best regards,
Gus
David Friedman-2 wrote:
>
> What was your final html ? Did it list them as two different columns (i.e
> "td" tags) or did it put them together? If it put them both inside one
> "td"
> tag, I recommend you try putting each h:form section inside the
> h:panelGroup
> tag or perhaps inside another "container" tag which works within
> h:panelGrid.
>
> Regards,
> David
>
> -----Original Message-----
> From: Gus [mailto:sheng.gu@gmail.com]
> Sent: Thursday, August 10, 2006 2:34 PM
> To: users@myfaces.apache.org
> Subject: RE: Problem with myfaces/facelets template.xhtml
>
>
>
> Hi David,
>
> Thank you for your very quick reply. I got a little understand. Yes, the
> two
> ui:include(header and footer) go to the right way, but the ui:insert
> (sidebar and content) are not rendered correctly in the h:panelGrid
> columns="2". Could you please give me some advice modifying it? Thanks
> again
> for your help.
>
> Gus
>
>
> David Friedman-2 wrote:
>>
>> Gus,
>>
>> There is a little thing with Facelets that some components are compile
>> time
>> and some are render time. I think you are mixing the two. You might try
>> putting each form inside h:panelGroup so ui:include can be sure where to
>> place itself. Also, did you get your columns created in the
>> final/outputted
>> html or is it skipping that, which might support my suggestion.
>>
>> Regards,
>> David
>>
>> -----Original Message-----
>> From: Gus [mailto:sheng.gu@gmail.com]
>> Sent: Thursday, August 10, 2006 1:50 PM
>> To: users@myfaces.apache.org
>> Subject: Problem with myfaces/facelets template.xhtml
>>
>>
>>
>> Hi everyone,
>>
>> I just begin to learn Facelets and Myfaces. I created a template, but the
>> template did display as expected. The "sidebar" and "content" should be
>> displayed in two columns as left and right, but it always display in one
>> columns as up and down. I really do not have any idea how to fix it. Any
>> help will be apprieciated. Thank you in advance.
>>
>> Gus
>> ============= Template.xhtml ==================
>>
>> <t:document 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:t="http://myfaces.apache.org/tomahawk"
>> xmlns:http="http://www.disy.de/commons/facelets/tag/http">
>> <f:view>
>> <t:documentHead>
>>
>> <title>Global Documents</title>
>> <t:stylesheet path="styles.css"/>
>>
>> <!-- include file="/template/_jscript.js" -->
>> <!--@ include file="/template/AjaxRequest.js" -->
>> </script>
>> </t:documentHead>
>> <t:documentBody>
>> <h:panelGrid columns="1" styleClass="mainBody"
>> rowClasses="row"
>> cellspacing="0" cellpadding="0" border="1">
>> <!-- header insert -->
>> <f:facet name="header">
>> <h:form id="menuForm">
>> <ui:include src="header.xhtml"/>
>> </h:form>
>> </f:facet>
>>
>> <!-- body insert -->
>> <h:panelGrid columns="2" border="0"
>> styleClass="contentBody"
>> columnClasses="sidemenu, content"
>> cellspacing="1" cellpadding="0">
>>
>> <!-- submenu of side bar insert -->
>> <h:form id="sidemenuForm">
>> <ui:insert name="sidebar"/>
>> </h:form>
>>
>> <!-- content insert -->
>> <h:form id="contentForm"
>> enctype="multipart/form-data">
>> <ui:insert name="content"/>
>> </h:form>
>> </h:panelGrid>
>>
>> <!-- footer insert -->
>> <f:facet name="footer">
>> <ui:include src="footer.xhtml"/>
>> </f:facet>
>> </h:panelGrid>
>> </t:documentBody>
>> </f:view>
>> </t:document>
>> --
>> View this message in context:
>>
> http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
>> .html#a5749229
>> Sent from the MyFaces - Users forum at Nabble.com.
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
> .html#a5749920
> Sent from the MyFaces - Users forum at Nabble.com.
>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138.html#a5752389
Sent from the MyFaces - Users forum at Nabble.com.
RE: Problem with myfaces/facelets template.xhtml
Posted by David Friedman <hu...@ix.netcom.com>.
What was your final html ? Did it list them as two different columns (i.e
"td" tags) or did it put them together? If it put them both inside one "td"
tag, I recommend you try putting each h:form section inside the h:panelGroup
tag or perhaps inside another "container" tag which works within
h:panelGrid.
Regards,
David
-----Original Message-----
From: Gus [mailto:sheng.gu@gmail.com]
Sent: Thursday, August 10, 2006 2:34 PM
To: users@myfaces.apache.org
Subject: RE: Problem with myfaces/facelets template.xhtml
Hi David,
Thank you for your very quick reply. I got a little understand. Yes, the two
ui:include(header and footer) go to the right way, but the ui:insert
(sidebar and content) are not rendered correctly in the h:panelGrid
columns="2". Could you please give me some advice modifying it? Thanks again
for your help.
Gus
David Friedman-2 wrote:
>
> Gus,
>
> There is a little thing with Facelets that some components are compile
> time
> and some are render time. I think you are mixing the two. You might try
> putting each form inside h:panelGroup so ui:include can be sure where to
> place itself. Also, did you get your columns created in the
> final/outputted
> html or is it skipping that, which might support my suggestion.
>
> Regards,
> David
>
> -----Original Message-----
> From: Gus [mailto:sheng.gu@gmail.com]
> Sent: Thursday, August 10, 2006 1:50 PM
> To: users@myfaces.apache.org
> Subject: Problem with myfaces/facelets template.xhtml
>
>
>
> Hi everyone,
>
> I just begin to learn Facelets and Myfaces. I created a template, but the
> template did display as expected. The "sidebar" and "content" should be
> displayed in two columns as left and right, but it always display in one
> columns as up and down. I really do not have any idea how to fix it. Any
> help will be apprieciated. Thank you in advance.
>
> Gus
> ============= Template.xhtml ==================
>
> <t:document 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:t="http://myfaces.apache.org/tomahawk"
> xmlns:http="http://www.disy.de/commons/facelets/tag/http">
> <f:view>
> <t:documentHead>
>
> <title>Global Documents</title>
> <t:stylesheet path="styles.css"/>
>
> <!-- include file="/template/_jscript.js" -->
> <!--@ include file="/template/AjaxRequest.js" -->
> </script>
> </t:documentHead>
> <t:documentBody>
> <h:panelGrid columns="1" styleClass="mainBody"
> rowClasses="row"
> cellspacing="0" cellpadding="0" border="1">
> <!-- header insert -->
> <f:facet name="header">
> <h:form id="menuForm">
> <ui:include src="header.xhtml"/>
> </h:form>
> </f:facet>
>
> <!-- body insert -->
> <h:panelGrid columns="2" border="0"
> styleClass="contentBody"
> columnClasses="sidemenu, content"
> cellspacing="1" cellpadding="0">
>
> <!-- submenu of side bar insert -->
> <h:form id="sidemenuForm">
> <ui:insert name="sidebar"/>
> </h:form>
>
> <!-- content insert -->
> <h:form id="contentForm"
> enctype="multipart/form-data">
> <ui:insert name="content"/>
> </h:form>
> </h:panelGrid>
>
> <!-- footer insert -->
> <f:facet name="footer">
> <ui:include src="footer.xhtml"/>
> </f:facet>
> </h:panelGrid>
> </t:documentBody>
> </f:view>
> </t:document>
> --
> View this message in context:
>
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
> .html#a5749229
> Sent from the MyFaces - Users forum at Nabble.com.
>
>
>
--
View this message in context:
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
.html#a5749920
Sent from the MyFaces - Users forum at Nabble.com.
RE: Problem with myfaces/facelets template.xhtml
Posted by Tom Innes <To...@allTiers.com>.
I had similar problems. What I have discovered is that if you place the
column in a h:panelGroup the issues will go away. I have noticed that
comments and jstl will cause the html to rendered incorrectly.
For Instance
<h:panelGroup>
<!-- submenu of side bar insert -->
<h:form id="sidemenuForm">
<ui:insert name="sidebar"/>
</h:form>
<\h:panelGroup>
>
>
Make sure any comments or jstl are inside the h:panelGroup
Hope this helps,
Tom
-----Original Message-----
From: Gus [mailto:sheng.gu@gmail.com]
Sent: Thursday, August 10, 2006 2:34 PM
To: users@myfaces.apache.org
Subject: RE: Problem with myfaces/facelets template.xhtml
Hi David,
Thank you for your very quick reply. I got a little understand. Yes, the two
ui:include(header and footer) go to the right way, but the ui:insert
(sidebar and content) are not rendered correctly in the h:panelGrid
columns="2". Could you please give me some advice modifying it? Thanks again
for your help.
Gus
David Friedman-2 wrote:
>
> Gus,
>
> There is a little thing with Facelets that some components are compile
> time
> and some are render time. I think you are mixing the two. You might try
> putting each form inside h:panelGroup so ui:include can be sure where to
> place itself. Also, did you get your columns created in the
> final/outputted
> html or is it skipping that, which might support my suggestion.
>
> Regards,
> David
>
> -----Original Message-----
> From: Gus [mailto:sheng.gu@gmail.com]
> Sent: Thursday, August 10, 2006 1:50 PM
> To: users@myfaces.apache.org
> Subject: Problem with myfaces/facelets template.xhtml
>
>
>
> Hi everyone,
>
> I just begin to learn Facelets and Myfaces. I created a template, but the
> template did display as expected. The "sidebar" and "content" should be
> displayed in two columns as left and right, but it always display in one
> columns as up and down. I really do not have any idea how to fix it. Any
> help will be apprieciated. Thank you in advance.
>
> Gus
> ============= Template.xhtml ==================
>
> <t:document 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:t="http://myfaces.apache.org/tomahawk"
> xmlns:http="http://www.disy.de/commons/facelets/tag/http">
> <f:view>
> <t:documentHead>
>
> <title>Global Documents</title>
> <t:stylesheet path="styles.css"/>
>
> <!-- include file="/template/_jscript.js" -->
> <!--@ include file="/template/AjaxRequest.js" -->
> </script>
> </t:documentHead>
> <t:documentBody>
> <h:panelGrid columns="1" styleClass="mainBody"
> rowClasses="row"
> cellspacing="0" cellpadding="0" border="1">
> <!-- header insert -->
> <f:facet name="header">
> <h:form id="menuForm">
> <ui:include src="header.xhtml"/>
> </h:form>
> </f:facet>
>
> <!-- body insert -->
> <h:panelGrid columns="2" border="0"
> styleClass="contentBody"
> columnClasses="sidemenu, content"
> cellspacing="1" cellpadding="0">
>
> <!-- submenu of side bar insert -->
> <h:form id="sidemenuForm">
> <ui:insert name="sidebar"/>
> </h:form>
>
> <!-- content insert -->
> <h:form id="contentForm"
> enctype="multipart/form-data">
> <ui:insert name="content"/>
> </h:form>
> </h:panelGrid>
>
> <!-- footer insert -->
> <f:facet name="footer">
> <ui:include src="footer.xhtml"/>
> </f:facet>
> </h:panelGrid>
> </t:documentBody>
> </f:view>
> </t:document>
> --
> View this message in context:
>
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
> .html#a5749229
> Sent from the MyFaces - Users forum at Nabble.com.
>
>
>
--
View this message in context:
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
.html#a5749920
Sent from the MyFaces - Users forum at Nabble.com.
RE: Problem with myfaces/facelets template.xhtml
Posted by Gus <sh...@gmail.com>.
Hi David,
Thank you for your very quick reply. I got a little understand. Yes, the two
ui:include(header and footer) go to the right way, but the ui:insert
(sidebar and content) are not rendered correctly in the h:panelGrid
columns="2". Could you please give me some advice modifying it? Thanks again
for your help.
Gus
David Friedman-2 wrote:
>
> Gus,
>
> There is a little thing with Facelets that some components are compile
> time
> and some are render time. I think you are mixing the two. You might try
> putting each form inside h:panelGroup so ui:include can be sure where to
> place itself. Also, did you get your columns created in the
> final/outputted
> html or is it skipping that, which might support my suggestion.
>
> Regards,
> David
>
> -----Original Message-----
> From: Gus [mailto:sheng.gu@gmail.com]
> Sent: Thursday, August 10, 2006 1:50 PM
> To: users@myfaces.apache.org
> Subject: Problem with myfaces/facelets template.xhtml
>
>
>
> Hi everyone,
>
> I just begin to learn Facelets and Myfaces. I created a template, but the
> template did display as expected. The "sidebar" and "content" should be
> displayed in two columns as left and right, but it always display in one
> columns as up and down. I really do not have any idea how to fix it. Any
> help will be apprieciated. Thank you in advance.
>
> Gus
> ============= Template.xhtml ==================
>
> <t:document 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:t="http://myfaces.apache.org/tomahawk"
> xmlns:http="http://www.disy.de/commons/facelets/tag/http">
> <f:view>
> <t:documentHead>
>
> <title>Global Documents</title>
> <t:stylesheet path="styles.css"/>
>
> <!-- include file="/template/_jscript.js" -->
> <!--@ include file="/template/AjaxRequest.js" -->
> </script>
> </t:documentHead>
> <t:documentBody>
> <h:panelGrid columns="1" styleClass="mainBody"
> rowClasses="row"
> cellspacing="0" cellpadding="0" border="1">
> <!-- header insert -->
> <f:facet name="header">
> <h:form id="menuForm">
> <ui:include src="header.xhtml"/>
> </h:form>
> </f:facet>
>
> <!-- body insert -->
> <h:panelGrid columns="2" border="0"
> styleClass="contentBody"
> columnClasses="sidemenu, content"
> cellspacing="1" cellpadding="0">
>
> <!-- submenu of side bar insert -->
> <h:form id="sidemenuForm">
> <ui:insert name="sidebar"/>
> </h:form>
>
> <!-- content insert -->
> <h:form id="contentForm"
> enctype="multipart/form-data">
> <ui:insert name="content"/>
> </h:form>
> </h:panelGrid>
>
> <!-- footer insert -->
> <f:facet name="footer">
> <ui:include src="footer.xhtml"/>
> </f:facet>
> </h:panelGrid>
> </t:documentBody>
> </f:view>
> </t:document>
> --
> View this message in context:
> http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
> .html#a5749229
> Sent from the MyFaces - Users forum at Nabble.com.
>
>
>
--
View this message in context: http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138.html#a5749920
Sent from the MyFaces - Users forum at Nabble.com.
RE: Problem with myfaces/facelets template.xhtml
Posted by David Friedman <hu...@ix.netcom.com>.
Gus,
There is a little thing with Facelets that some components are compile time
and some are render time. I think you are mixing the two. You might try
putting each form inside h:panelGroup so ui:include can be sure where to
place itself. Also, did you get your columns created in the final/outputted
html or is it skipping that, which might support my suggestion.
Regards,
David
-----Original Message-----
From: Gus [mailto:sheng.gu@gmail.com]
Sent: Thursday, August 10, 2006 1:50 PM
To: users@myfaces.apache.org
Subject: Problem with myfaces/facelets template.xhtml
Hi everyone,
I just begin to learn Facelets and Myfaces. I created a template, but the
template did display as expected. The "sidebar" and "content" should be
displayed in two columns as left and right, but it always display in one
columns as up and down. I really do not have any idea how to fix it. Any
help will be apprieciated. Thank you in advance.
Gus
============= Template.xhtml ==================
<t:document 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:t="http://myfaces.apache.org/tomahawk"
xmlns:http="http://www.disy.de/commons/facelets/tag/http">
<f:view>
<t:documentHead>
<title>Global Documents</title>
<t:stylesheet path="styles.css"/>
<!-- include file="/template/_jscript.js" -->
<!--@ include file="/template/AjaxRequest.js" -->
</script>
</t:documentHead>
<t:documentBody>
<h:panelGrid columns="1" styleClass="mainBody" rowClasses="row"
cellspacing="0" cellpadding="0" border="1">
<!-- header insert -->
<f:facet name="header">
<h:form id="menuForm">
<ui:include src="header.xhtml"/>
</h:form>
</f:facet>
<!-- body insert -->
<h:panelGrid columns="2" border="0"
styleClass="contentBody"
columnClasses="sidemenu, content"
cellspacing="1" cellpadding="0">
<!-- submenu of side bar insert -->
<h:form id="sidemenuForm">
<ui:insert name="sidebar"/>
</h:form>
<!-- content insert -->
<h:form id="contentForm" enctype="multipart/form-data">
<ui:insert name="content"/>
</h:form>
</h:panelGrid>
<!-- footer insert -->
<f:facet name="footer">
<ui:include src="footer.xhtml"/>
</f:facet>
</h:panelGrid>
</t:documentBody>
</f:view>
</t:document>
--
View this message in context:
http://www.nabble.com/Problem-with-myfaces-facelets-template.xhtml-tf2086138
.html#a5749229
Sent from the MyFaces - Users forum at Nabble.com.