1 Reply Latest reply on Jan 31, 2012 3:30 PM by healeyb

    how to invoke a event/bean method on Page reload?

    ashishagw

      I want to invoke a bean method or an event on every page reload.

       

      Can you please guide me as how to do so?

        • 1. Re: how to invoke a event/bean method on Page reload?
          healeyb

          Use <f:event type="preRenderView" listener="#{bean.setupPage}"/>. Note that this will get invoked even for

          partial ajax updates, so it can be useful to add a method to an abstract class of your backing bean like

          this:

           

          public boolean isAjaxRequest() {

                  return FacesContext.getCurrentInstance().getPartialViewContext().isAjaxRequest();

          }

           

          Regards,

          Brendan.