aspose file tools*
The moose likes JSF and the fly likes height tag is not working correctly in 'body' element. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "height tag is not working correctly in Watch "height tag is not working correctly in New topic
Author

height tag is not working correctly in 'body' element.

sharath kumar reddy karnati
Greenhorn

Joined: Jul 23, 2007
Posts: 5
Hi All,

Please find below script in written in HTML

<html>
<form>
<body height="500px;" style="background-color: yellow;" >
<table width="100%" border="1" cellpadding="0" cellspacing="0" style="background-color: #FFFFFF; border: 2 solid #0000C0">
<tr>
<td> first </td>
<td> second </td>
</tr>
<tr>
<td> three </td>
<td> four </td>
</tr>
</table>
</body>
</form>
</html>

When I run this HTML code it is dislaying yellow background in form and table is showing on top. When I do same thing in JSF with following code

<f:view>
<h:form>

<body style="height:500px" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">

<center>
<h:panelGrid width="100%" columns="2" border="0" columnClasses ="column1,column2" >
<center>

<hutputText value="User Id:" />
<h:inputText id="userId" value="#{LoginValidation.loginname}" />


<hutputText value=" " />
<h:commandButton value="Login" action="#{LoginValidation.CheckValidUser}" />

<hutputText value="New User?" />
<h:commandLink value="Register Here" action="newuser" />

</center>
</h:panelGrid>
</center>
</body>
</h:form>
</f:view>

When I'm executing this script, it is not showing the hight which I mentioned in <body> tag, it is taking default height depending upon the values mentioned in <h:panelGrid>.

In case, if I give height in <h:panelGrid> then it is working fine.

Please help.

Thanks in advance.

Regards,
Sharath.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

You've got some seriously messed-up HTML/JSF there. You start with <html> but end with <f:view> and your form/f:form construct isn't any better. Also, the HTML body tag goes outside the form tags. In JSF, all the tags have to match up properly and be in their proper places. Actually, that's true in HTML as well, but web browsers are more likely not to complain about bad tags. Though they may display unreliably.

I'm not sure a body tag can have a height attribute, since the height of a web page body is whatever the user sizes the window to be.

When you set dimensions in web page components, they will tend to "stretch" their containing components, which appears to be what you're seeing.
[ July 30, 2007: Message edited by: Tim Holloway ]

Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: height tag is not working correctly in 'body' element.
 
Similar Threads
Positioning DIVs
HTTP Status 405 error
JSF2 Modal Dialog Box
problem in using richfaces
JSTL and bean data