You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Gregg D Bolinger <gt...@gmail.com> on 2005/10/09 20:43:41 UTC

Tiles Problem

I just started using Tiles on a project. Everything was working fine as for
as layout is concerned when I had my template and then my content page(s)
had their own f:view. Problem with that I learned is it didn't allow form
submissions to work. So I moved the f:view tag into the template and made
the tiles:includes children of a subview for each include. After I did that,
the layout of my page is all messed up. If I change it back, the layout is
fine.

Here is the template:

<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<html>
<head>
<title></title>
<link href="styles/main.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript"></script>
<decorator:head/>
</head>

<f:view>
<body>
<table width="100%" height="100%" border="0" align="center" cellPadding="0"
cellSpacing="0">
<tr>
<td align="center" valign="middle">

<tiles:insert attribute="body" flush="false"/>

</td>
</tr>
<tr>
<td>
<f:subview id="footer">
<tiles:insert attribute="footer" flush="false"/>
</f:subview>
</td>
</tr>
</table>
</body>
</f:view>
</html>

And here is the body content

<%@ page contentType="text/html" %>
<%@ include file="includes/taglibs.jsp" %>

<f:subview id="newAccountView">
<h:form>

<table width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="310" colspan="3">
<h:graphicImage url="images/topbar_main.gif" width="750" height="75"/>
</td>
</tr>
<tr>
<td colspan="3">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<h:graphicImage url="images/page_titles/create_profile.gif" width="250"
height="25"
style="border: none;"/>
</td>
<td align="right"><h:graphicImage url="images/page_titles/step_1.gif"
width="250" height="25"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="250" rowspan="2" class="redcell"><span
class="boldfonts">USERNAME</span><br>
You must enter a username here. This will be the name that other users will
see in your profile as well as your
login ID</td>
<td width="10" rowspan="20">&nbsp;</td>
<td align="right" class="tablebody">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" class="headingtext">username</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" class="tablebody">
<h:inputText id="username" value="#{registrationController.username}"
styleClass="formtext" required="true"/>
</td>
</tr>
<tr>
<td width="250" class="redcell">&nbsp;</td>
<td align="right" class="tablebody">&nbsp;</td>
</tr>
<tr>
<td width="250" rowspan="3" class="redcell"><span
class="boldfonts">EMAIL</span><br>
Enter your email address. This is the only way we can contact you and that
you may retrieve your
password if you forget it.</td>
<td align="right" class="tablebody">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" class="headingtext">email address </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" class="tablebody">
<h:inputText id="email" value="#{registrationController.email}"
styleClass="formtext" required="true"/>
</td>
</tr>
<tr>
<td align="right" class="tablebody">&nbsp;</td>
</tr>
<tr>
<td width="250" class="redcell">&nbsp;</td>
<td align="right" class="tablebody">&nbsp;</td>
</tr>
<tr>
<td width="250" rowspan="2" class="redcell"><span
class="boldfonts">PASSWORD</span><br>
You must enter a password. Your password should be at least 6 characters
long.</td>
<td align="right" class="tablebody">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" class="headingtext">
<h:outputLabel for="password1">
<h:outputText value="Password"/>
</h:outputLabel>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" class="tablebody">
<h:inputSecret id="password1" value="#{registrationController.password1}"
styleClass="formtext"/>
</td>
</tr>
<tr>
<td width="250" class="redcell">&nbsp;</td>
<td align="right" class="tablebody">&nbsp;</td>
</tr>
<tr>
<td width="250" rowspan="2" class="redcell"><span class="boldfonts">VERIFY
PASSWORD</span><br>
You must enter your password again to verifty it.</td>
<td align="right" class="tablebody">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" class="headingtext">verify password </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" class="tablebody">
<h:inputSecret id="password2" value="#{registrationController.password2}"
styleClass="formtext"/>
</td>
</tr>
<tr>
<td width="250" class="redcell">&nbsp;</td>
<td align="right" class="tablebody">&nbsp;</td>
</tr>
<tr>
<td width="250" rowspan="2" class="redcell"><span class="boldfonts">PHONE
NUMBER</span><br>
A notification is sent to your mobile device when a user has responded to
your profile. Acts as a search by area
code.</td>
<td align="right" class="tablebody">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" class="headingtext">phone number </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" class="tablebody"><input name="areaCode" type="text"
class="formtext" size="3" maxlength="3">
<h:inputText id="phone" value="#{registrationConroller.phone}"
styleClass="formtext"/>
<br>
(optional)</td>
</tr>
<tr>
<td width="250" class="redcell">&nbsp;</td>
<td align="right" class="tablebody">&nbsp;</td>
</tr>
<tr>
<td width="250" rowspan="2" class="redcell"><span class="boldfonts">ZIP
CODE</span><br>
Your zip code will be used to generate the city and state where you reside
and will serve as a search criteria.
</td>
<td align="right" class="tablebody">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" class="headingtext">zip code </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" class="tablebody">
<h:inputText id="zipcode" value="#{registrationController.zipcode}"
styleClass="formtext" required="true"/>
</td>
</tr>
<tr>
<td width="250" class="redcell">&nbsp;</td>
<td align="right" class="tablebody">&nbsp;</td>
</tr>
<tr>
<td width="250" class="redcell">&nbsp;</td>
<td align="right" class="tablebody">


<h:commandLink action="#{registrationController.newRegistrationStepTwo}">
<h:graphicImage url="images/circle_buttons/go_red_1.gif" style="border:
none;" width="35" height="35"
onmouseover="this.src='images/circle_buttons/go_red_2.gif';" onmouseout="
this.src='images/circle_buttons/go_red_1.gif';"/>
</h:commandLink>

</td>
</tr>
</table>
</td>
</tr>
</table>

</h:form>
</f:subview>

Re: Tiles Problem

Posted by Gregg D Bolinger <gt...@gmail.com>.
Cool. Thanks. I'll look into that.

Gregg

On 10/12/05, Benjamin Shrom <bs...@yahoo.com> wrote:
>
> Or you can use:
> http://jsftutorials.net/htmLib/
>
> There is a slight performance hit, but hell - it's
> perfect html :-) and it allows you to use static id's
> if you need them for stylesheets or anything else...
>
> --- Gregg D Bolinger <gt...@gmail.com> wrote:
>
> > Ugh! That is horrible. But understandable. Thanks
> > for the information.
> >
> > Gregg
> >
> > On 10/9/05, Simon Kitching <sk...@obsidium.com>
> > wrote:
> > >
> > > Gregg D Bolinger wrote:
> > > > I just started using Tiles on a project.
> > Everything was working fine as
> > > > for as layout is concerned when I had my
> > template and then my content
> > > > page(s) had their own f:view. Problem with that
> > I learned is it didn't
> > > > allow form submissions to work. So I moved the
> > f:view tag into the
> > > > template and made the tiles:includes children of
> > a subview for each
> > > > include. After I did that, the layout of my page
> > is all messed up. If
> > > > I change it back, the layout is fine.
> > >
> > > Yep, this is a known problem when combining JSF
> > 1.1 and JSP 2.0.
> > >
> > > The upcoming JSF1.2/JSP2.1 specs address this
> > issue but in the meantime
> > > there's no solution except to ensure that *all*
> > data in included pages
> > > is output by JSF tags. If you really want to
> > output plain HTML or text
> > > then you have to wrap them in JSF tags (f:verbatim
> > or h:outputText).
> > >
> > > Or change to using facelets for the presentation
> > layout instead of JSP.
> > >
> > > Regards,
> > >
> > > Simon
> > >
> >
>
>
>
>
> __________________________________
> Yahoo! Music Unlimited
> Access over 1 million songs. Try it free.
> http://music.yahoo.com/unlimited/
>

Re: Tiles Problem

Posted by Benjamin Shrom <bs...@yahoo.com>.
Or you can use:
http://jsftutorials.net/htmLib/

There is a slight performance hit, but hell - it's
perfect html :-) and it allows you to use static id's
if you need them for stylesheets or anything else...

--- Gregg D Bolinger <gt...@gmail.com> wrote:

> Ugh! That is horrible. But understandable. Thanks
> for the information.
> 
> Gregg
> 
> On 10/9/05, Simon Kitching <sk...@obsidium.com>
> wrote:
> >
> > Gregg D Bolinger wrote:
> > > I just started using Tiles on a project.
> Everything was working fine as
> > > for as layout is concerned when I had my
> template and then my content
> > > page(s) had their own f:view. Problem with that
> I learned is it didn't
> > > allow form submissions to work. So I moved the
> f:view tag into the
> > > template and made the tiles:includes children of
> a subview for each
> > > include. After I did that, the layout of my page
> is all messed up. If
> > > I change it back, the layout is fine.
> >
> > Yep, this is a known problem when combining JSF
> 1.1 and JSP 2.0.
> >
> > The upcoming JSF1.2/JSP2.1 specs address this
> issue but in the meantime
> > there's no solution except to ensure that *all*
> data in included pages
> > is output by JSF tags. If you really want to
> output plain HTML or text
> > then you have to wrap them in JSF tags (f:verbatim
> or h:outputText).
> >
> > Or change to using facelets for the presentation
> layout instead of JSP.
> >
> > Regards,
> >
> > Simon
> >
> 



		
__________________________________ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

Re: Tiles Problem

Posted by Gregg D Bolinger <gt...@gmail.com>.
Ugh! That is horrible. But understandable. Thanks for the information.

Gregg

On 10/9/05, Simon Kitching <sk...@obsidium.com> wrote:
>
> Gregg D Bolinger wrote:
> > I just started using Tiles on a project. Everything was working fine as
> > for as layout is concerned when I had my template and then my content
> > page(s) had their own f:view. Problem with that I learned is it didn't
> > allow form submissions to work. So I moved the f:view tag into the
> > template and made the tiles:includes children of a subview for each
> > include. After I did that, the layout of my page is all messed up. If
> > I change it back, the layout is fine.
>
> Yep, this is a known problem when combining JSF 1.1 and JSP 2.0.
>
> The upcoming JSF1.2/JSP2.1 specs address this issue but in the meantime
> there's no solution except to ensure that *all* data in included pages
> is output by JSF tags. If you really want to output plain HTML or text
> then you have to wrap them in JSF tags (f:verbatim or h:outputText).
>
> Or change to using facelets for the presentation layout instead of JSP.
>
> Regards,
>
> Simon
>

Re: Tiles Problem

Posted by Simon Kitching <sk...@obsidium.com>.
Gregg D Bolinger wrote:
> I just started using Tiles on a project.  Everything was working fine as 
> for as layout is concerned when I had my template and then my content 
> page(s) had their own f:view.  Problem with that I learned is it didn't 
> allow form submissions to work. So I moved the f:view tag into the 
> template and made the tiles:includes children of a subview for each 
> include.  After I did that, the layout of my page is all messed up.  If 
> I change it back, the layout is fine.

Yep, this is a known problem when combining JSF 1.1 and JSP 2.0.

The upcoming JSF1.2/JSP2.1 specs address this issue but in the meantime 
there's no solution except to ensure that *all* data in included pages 
is output by JSF tags. If you really want to output plain HTML or text 
then you have to wrap them in JSF tags (f:verbatim or h:outputText).

Or change to using facelets for the presentation layout instead of JSP.

Regards,

Simon