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.
Below code I have used in layout.xhtml
<li class="#{loginBean.subMenu eq 'Booking_History' ? 'active' : ''}">
<p:commandLink rendered="#{loginBean.logedadmin or loginBean.logedagent}" action="#{bookingHistoryBean.showList}" value="Booking History"
immediate="true">
</p:commandLink>
java method
public String showList() {
startLoadingBar();
status="All";
noOfRecords=0;
getList();
searchBookingHistory();
log.info("Loaded successfully");
return "/pages/internalstackholders/bookinghistory.jsf?faces-redirect=true";
}
In bookinghistory.xhtml
<p:dialog widgetVar="statusDialog" id="statusbar" modal="true"
showEffect="fade" showHeader="false" closable="false" width="250"
resizable="false">
<h:form>
<center>
<img src="#{request.contextPath}/resources/images/loading.gif" /><br />
<b>Please wait...</b><br />
<br />
</center>
</h:form>
</p:dialog>
Any body having any suggestion.