Reputation:
I'd like to call an ActionListener
and rerender some parts of my page when the page has been loaded (window.onload
). How can I do this?
I can't edit the body
tag. I've got a portlet inside a portal server.
Upvotes: 4
Views: 4379
Reputation: 11
<h:form>
<a4j:jsFunction name="doSome" actionListener="#{bean.init}" reRender="some" />
</h:form>
<jsfc:verbatim>
<script type="text/javascript">
window.onload = doSome();
</script>
</jsfc:verbatim>
Upvotes: 1
Reputation: 1109625
Use <a4j:jsFunction>
.
<h:form>
<a4j:jsFunction name="init" actionListener="#{bean.init}" reRender="some" />
</h:form>
<script>window.onload = init;</script>
Upvotes: 2