Since this is a FAQ, I created a WIKI page for it: http://wiki.apache.org/myfaces/Execute_action_on_page_load
-Andrew On 11/5/07, Andrew Robinson <[EMAIL PROTECTED]> wrote: > Look at: > > jsf-comp onload > http://jsf-comp.sourceforge.net/components/onload/index.html > > jboss seam pages.xml: > http://docs.jboss.org/seam/1.2.1.GA/reference/en/html/events.html#d0e3776 > > shale: > http://shale.apache.org/shale-view/index.html > > > On 11/5/07, daniel ccss <[EMAIL PROTECTED]> wrote: > > In Google I find this solution: > > > > you can try body on~load calls a javascript method, then in the javascript > > method calls a commandbutton which is hidden. that commandbutton can then > > call a method in your backing bean. > > > > code:________________________________ > > > > function test(){ > > document.getElementById('formName:buttonId').click(); > > > > } > > > > <body on~load="test();"> > > > > <h:commandButton action="#{backingBean.methodName}" id="buttonId" > > style="display: none"/> > > </body> > > > > Any other idea?? > > > > > > > > > > > > > > On 11/5/07, daniel ccss <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > > > > I need to call a method on my backing bean (is in session scope) when a > > jsp is showing. Why? Because I some cases I need to erase some elements in > > session before showing the jsp. So in the onload of the JSPs I need to call > > the method on my backing bean that erase the elements in session. > > > > > > So my question is, how to call a Baccking Bean method on the onLoad event > > of the body in the JSP. > > > > > > Thanks > > > > > > > >

