RichFaces 3.3: Call actionListener on window.onload

I want to call ActionListener and reload some parts of my page when the page has been loaded ( window.onload ). How can i do this?


I cannot edit the body tag. I have a portlet inside the portal server.

+4
source share
2 answers

Use <a4j:jsFunction> .

 <h:form> <a4j:jsFunction name="init" actionListener="#{bean.init}" reRender="some" /> </h:form> <script>window.onload = init;</script> 
+2
source
 <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> 
+1
source

Source: https://habr.com/ru/post/1381870/


All Articles