title: Before fully loading page loading bar is hided in jsf
body: <p>Actually I am getting loading bar but before page content get loaded loading bar is hided. I want loading bar until page is not loaded correctly.</p>
  
  <p>Below code I have used in layout.xhtml</p>
  
  <pre><code> &lt;li class="#{loginBean.subMenu eq 'Booking_History' ? 'active' : ''}"&gt;
            &lt;p:commandLink rendered="#{loginBean.logedadmin or loginBean.logedagent}" action="#{bookingHistoryBean.showList}" value="Booking History"
                          immediate="true"&gt;
                          &lt;/p:commandLink&gt;
  </code></pre>
  
  <p></li></p>
  
  <p>java method</p>
  
  <pre><code>public String showList() {
      startLoadingBar();
      status="All";
      noOfRecords=0;
      getList();
      searchBookingHistory();
      log.info("Loaded successfully");
      return "/pages/internalstackholders/bookinghistory.jsf?faces-redirect=true";
  }
  </code></pre>
  
  <p>In bookinghistory.xhtml</p>
  
  <pre><code> &lt;p:dialog widgetVar="statusDialog" id="statusbar" modal="true"
          showEffect="fade" showHeader="false" closable="false" width="250"
          resizable="false"&gt;
      &lt;h:form&gt;
        &lt;center&gt;
          &lt;img src="#{request.contextPath}/resources/images/loading.gif" /&gt;&lt;br /&gt;
          &lt;b&gt;Please wait...&lt;/b&gt;&lt;br /&gt;
          &lt;br /&gt;
        &lt;/center&gt;
      &lt;/h:form&gt;
    &lt;/p:dialog&gt;
  </code></pre>
  
  <p>Any body having any suggestion.</p>