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 onload function in tiles 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 "onload function in tiles" Watch "onload function in tiles" New topic

onload function in tiles

Shyam Sunder

Joined: Dec 23, 2006
Posts: 24
hi friends,

my requirement is onload of page. The application should perform some validations.
we are using struts tiles, i want to load the function to call that so pls help
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
It's important to realize that when you use tiles, each JSP used in the tiles template becomes a page fragment, and is no longer a complete page. For this reason, using the onload event just isn't a very good option for tiles. My suggestion would be to just put the JavaScript code inline with your HTML (not a function definition, but acutal, executable JavaScript). That way it will execute when the page loads and will work similar to using the onload event.
[ August 21, 2007: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
I agree. Here's the link:
subject: onload function in tiles
Similar Threads
Checking for a specific value
why onload() in body unable to call out ?
JSP + javasscript
Disabling the alert in child pages-- java script
Defining onLoad() function for a struts tiles page