Reputation: 79
I want to put loading sign before the result would be delivered to me.
for example I can change press different colors with this:
<!-- ColorFilter -->
<span class="select-one-container">
<p:selectOneButton id="colorFilter" value="#{productView.color}">
<p:ajax update="mainForm" listener="#{productView.applyFilters}" oncomplete="PF('colorTable').filter();"/>
<f:selectItem itemLabel=" #{colorText.filter_new} " itemValue="red" itemDescription="#{pRevText.filter_new_description}"/>
<f:selectItem itemLabel=" #{pRevText.filter_marked}" itemValue="blue" itemDescription="#{pRevText.filter_marked_description}"/>
</p:selectOneButton>
</span>
and before "applyFilters" is done, it should just show loading sign, i do not want to see the old results there
or just not show anything before the results come back
Is there an option before "oncomplete" for ajax events?
Upvotes: 0
Views: 45
Reputation: 6184
Is there an option before "oncomplete" for ajax events?
onstart
Another option is ajax status: https://www.primefaces.org/showcase/ui/ajax/status.xhtml
and blockUI as suggested by @AshishMathew.
Upvotes: 1