I am developing a presentation for my site that has a standard login and landing page, and I want the onLoad function to call my login page, but not for my other pages (for now). I have a template.xhtml file that has this insert:
<div id="content"> <ui:insert name="content"/> </div>
Then in login.xhtml I have:
<ui:define name="content"> ... </ui:define>
Normally I would put this in login.xhtml:
<body onload="document.getElementById('login_form:name').focus();">
But since I use JSF ui composition tags, I cannot have the <body/> in login.xhtml (at least the way I'm trying to do this).
Is there any way to do this with the structure I described? The way I think is to make the onLoad function call the function in the template, and then each page with ui: define would fill that function. Is it possible?
Thanks!
source share