This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Tiles - different onload method for pages using same layout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Tiles - different onload method for pages using same layout" Watch "Tiles - different onload method for pages using same layout" New topic
Author

Tiles - different onload method for pages using same layout

Mah Hasan
Greenhorn

Joined: Apr 19, 2007
Posts: 11
Hi all,

Is there a way to have a seperate onload for two different pages using the same Layout?

I am using Tile framework with Struts. I have a MyBasicLayout.jsp file. This file has the body tag. I have two other layouts extending from this layout. Is there a way I can call two different onload methods depending on which child layout I am displaying.

To clarify my question even further, if two pages are using the same layout and layout has the body tag. Is there a way to have different onload method for each of these pages?

Can different tiles have different onload methods?

Any help is appreciated.

Thanks,
Mahrukh.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
See question 4 of the JavaRanch Struts FAQ. The problem addressed in the FAQ is slightly different than yours, but once you read it, I'm sure you will see how you can use the same technique to solve your problem.


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tiles - different onload method for pages using same layout
 
Similar Threads
Defining onLoad() function for a struts tiles page
Tiles and image preloading
Tiles Question - howto solve variety body ?
How to go back to a page
script tag location