Have the following issue: there is p:remoteCommand that lazy loads p:dataTable after page load, but the load indicator of "p:ajaxStatus" is not shown during the time of the ajax request...
How to make "p:ajaxStatus" to be shown on the page when p:remoteCommand sends request for lazy loading of the data?
Code on the page:
<h:form id="form">
<p:remoteCommand name="loadLazyData" action="#{crmBackingBean.crmOnControlLazyInit}" autoRun="true" process="@this" update="dtCrmOnControl" />
<p:dataTable id="dtCrmOnControl" var="rowData" value="#{crmBackingBean.crmOnControlLazy}" widgetVar="dtCrmOnControl" rows="#{crmBackingBean.crmDTonControlRows}" paginator="true" ..... lazy="true" >
.......................................................
</p:dataTable>
</h:form>
I use Atlas theme, p:ajaxStatus is located in its original place, in template.xhtml:
<p:ajaxStatus style="width:40px; height:40px; position:fixed; right:30px; bottom:30px; z-index:999999;">
<f:facet name="start">
<i class="fa fa-circle-o-notch fa-spin Green Fs40"></i>
</f:facet>
<f:facet name="complete">
<h:outputText value="" />
</f:facet>
</p:ajaxStatus>
Thank you!
Versions: PrimeFaces 6.0.2; PrimeFaces Atlas Theme 1.1.1; GlassFish 4.1.1 with JSF 2.2.12 (Mojarra)
<p:commandButton type="button" onclick="loadLazyData" />
and manually click on the button? Does it work if you use the<p:ajaxStatus>
inside the same form? – Kukeltje<p:commandButton type="button" onclick="loadLazyData();" />
works, and actually it made me able to find the solution: I use standard PrimeFaces Atlas theme, and its standard template contains<p:ajaxStatus />
tag after<ui:insert name="content">
, thus obviously ajaxStatus just simply doesn't "hear" "remoteCommand" as it loaded after remoteCommand (actually not sure whether it is bug or feature...) So basically my fix was just to move<p:ajaxStatus />
above and put it as first tag after ` <h:body>` code – AndrewG10i