This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Non-scrollable Tile? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Non-scrollable Tile?" Watch "Non-scrollable Tile?" New topic
Author

Non-scrollable Tile?

bryan nelson
Ranch Hand

Joined: Jun 16, 2003
Posts: 95
Good morning,

I have a web application that I need to display a constant banner at the top of. It needs to be non scrollable as well. Just a solid inch deep banner that stays visible no matter where you go in the site below.

Now I know that I can do this with frames, but I really don't want to go there if I don't have to. I'm assuming that I can do something like this with a tile perhaps? Is there a better way? I'm using Struts 1.1.

Any ideas are appreciated.

Thanks,
b


"...and the Truth will set you free."
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Tiles get rendered into html before the browser ever sees anything. This means that your solution must come from html or javascript, as tiles do not directly affect how a browser interprets the html.

Frames are one option. Javascript is another option but such a solution with Javascript... let's just say it's difficult to get smooth-scrolling. It might also be possible to put all the rest of the page's content in a scrollable area within the browser window.


A good workman is known by his tools.
bryan nelson
Ranch Hand

Joined: Jun 16, 2003
Posts: 95
After thinking a little bit more about the nature of tiles, I understand what you're saying. And I've decided to stay away from the JavaScript if I can. I'm trying to use an IFrame to accomplish my goal. Which I can do just fine. However, I'm having trouble using that AND tiles. I'm currently doing something like this (which is failing):

In my tile definition I have this:

<definition name="mySite.default"
path="/web/jsp/layout/defaultIFrame.jsp">
<put name="header" value="/web/jsp/include/header.jsp" />
<put name="menubar" value="/web/jsp/include/menubar.jsp" />
<put name="left-nav" value="/web/jsp/include/leftNavigation.jsp"/>
<put name="body-content" value="/web/jsp/homeBody.jsp" />
<put name="sessionbar" value="/web/jsp/include/sessionbar.jsp" />
<put name="footer" value="/web/jsp/include/footer.jsp" />
</definition>

where I changed the item in gray to point to the IFrame as you can see above (it used to point to the Layout below).

In my new defaultIFrame.jsp I have this:

<html>
<head>
<title>Test</title>
</head>

<body>
<table class="unclassified">
<tr>
<td>Green</td>
</tr>
</table>
<iframe width='100%' height='92%' src='<html:rewrite page="/web/jsp/layout/defaultLayout.jsp" />' frameborder='no' scrolling='yes'></iframe>
</body>
</html>

This works in the sense that it gives me the little unscrollable piece at the top (the table with the "green" TD), but the Iframe below gives a jsp NPE because of the tile attributes being blank. And I understand that too, because I'm not calling the defaultLayout.jsp from the tile-def'n any longer and it has no knowledge of the "puts" (if you will) once I get to the regular jsp page.

So my question is...how do I make it so I can display an entire tiles layout in an Iframe? There has to be a way to do this...

Thanks again!
bryan
[ March 23, 2005: Message edited by: bryan nelson ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You have two choices, frame your page

or do a search on google for JavaScript watermark.

Eric
bryan nelson
Ranch Hand

Joined: Jun 16, 2003
Posts: 95
Well the watermark is out.

Looks like I'll have to resort to frames. *wince*
 
 
subject: Non-scrollable Tile?
 
Similar Threads
opening file to textfield
Scrollable ResultSet
How can I achieve this layout?
Scrollable ResultSet
DB2 V9.1 for z/OS