0 Replies Latest reply on Aug 25, 2008 6:47 PM by Scott Basinger

    Deferred Data Loading

    Scott Basinger Newbie

      I have a dashboard page that has several data tables that get their data from external reources (our ERP). There's also several data tables that get data locally and load really fast. What I'd like to do is show the page with the fast data loaded, and then get the other data in the background, while showing the spinner.gif on the slow loading tables. I have one slow loading table working using a4j:support and some wierd javascript. When I tried to duplicate for a second table, a4j:support kept updating the first table instead. There must be a better way?

      <ui:define name="body">
       <h:form id="page1">
       <rich:panel id="mainPanel">
       <h:panelGrid columns="2" columnClasses="column.fifty, column.fifty" id="mainGrid">
       <rich:panel id="MyGuestSalesPanel" header="My Guest Sales">
       <h:inputHidden id="myGuestSalesLoadData">
       <a4j:support event="onchange"
       reRender="personalSalesList" limitToList="true"/>
       <a4j:status id="myGuestSalesStatus">
       <f:facet name="start">
       <h:graphicImage value="/img/spinner.gif" />
       <rich:dataTable id="personalSalesList" var="_salesBean"
       <f:facet name="header">
       <h:outputText value="Sales Month" />
       <h:outputText value="#{_salesBean.salesDate}">
       <f:convertDateTime type="date" pattern="MMM yyyy"/>
       <f:facet name="header">
       <h:outputText value="Month To Date" />
       <h:outputText value="#{_salesBean.periodSales}" />
       <f:facet name="header">
       <h:outputText value="Year To Date" />
       <h:outputText value="#{_salesBean.yearToDateSales}"/>
       <rich:panel header="Show Order Status">
       <h:inputText id="showOrderLoadData">
       <a4j:support id="orderStatusSupport" event="onchange"
       reRender="showOrderList" limitToList="true" />
       <rich:dataTable id="showOrderList" var="_orderBean"
       value="#{LOISTransactionManager.lastFiveShows}" >
       . </rich:dataTable>
       function changeData() {
       page1:myGuestSalesLoadData = "true";
       page1:showOrderLoadData = "true";
       ,'actionUrl':'/testfromoracle/LandingPage.seam','affected':['page1:personalSalesList'] } );
       window.onload = function()