2 Replies Latest reply on Apr 29, 2011 9:12 AM by Nikhil Patil

    Loading data after a page has completed rendering

    Nikhil Patil Newbie

      Hi Guys! Need community help here!

      I understand that the JSF components are processed at the server side. Some of my pages are really data centric. So when I load that page (eg: inside a richTab with switchType ajax), it takes a lot of time for my bean to execute the method marked with @PostConstruct to execute and fetch data. And hence the time period between user clicking on the tab's header and actual page rendering is quite large, a really bad user experience. I've implemented lazy loading for the dataTables in the page but that still doesn't optimize my page load time since @PostConstruct is still there.

      Is there anyway I can load the page first and THEN fetch the data with ajax and update the page? This loading time is really annoying for the user.Any help appreciated

      PS: I thought of using the oncomplete and onbeforedomupdate client side events of rich:taband call ajax functions declared with a4j:function. But it seems that these events are fired beforethe page is actually switched