I have a problem with canceling an Ajax request. Our application interface is built in the Russian Federation.
There should be a cancel button on the progress bar β this is an interrupt operation, for example, to cancel filling control from the database. How to do it?
I tried using the overload page, flags with "if" conditions on the getters for the controls, and also using "bypassUpdates" without positive effects.
Thank you in advance for your help.
XHTML (button):
<a4j:commandButton id="showData" value="View" styleClass="hBtn" disabled="#{events.isButtonsDisabled}" oncomplete="if (#{facesContext.maximumSeverity==null}) {window.open('/seed/pages/data.jsf','DATA')};" actionListener="#{events.actionShow}"/>
JAVA: (button):
public void actionShow(ActionEvent evt) {
XHTML (Home - showing a pending pop-up)
<a4j:form> <a4j:status id="ajaxStat" onstart="Richfaces.showModalPanel('waitPanel');" onstop="#{rich:component('waitPanel')}.hide()" /> </a4j:form>
XHTML (popup):
<rich:modalPanel id="waitPanel" autosized="true" moveable="false" minWidth="250" styleClass="popup"> <f:facet name="header"> <h:panelGroup> <h:outputText value="Operation in progress"></h:outputText> </h:panelGroup> </f:facet> <f:facet name="controls"> <h:panelGroup> <h:graphicImage value="../images/icons/action_close.gif" styleClass="hidelink" id="hidelink"/> <rich:componentControl for="waitPanel" attachTo="hidelink" operation="hide" event="onclick"/> </h:panelGroup> </f:facet> <a4j:form id="msgFrm" ajaxSubmit="true"> <h:outputText value="Please wait..."/> <h:graphicImage styleClass="progressBar" value="../images/indicatorbar.gif"/> <a4j:commandButton value="Cancel" type="button" onclick="#{rich:component('waitPanel')}.hide()" action="#{main.cancelAction}" bypassUpdates="true"/> </a4j:form> </rich:modalPanel>
JAVA (popup):
public void cancelAction(){ //there was setter for true/false flag for actionShow() here, now there is nothing here (it was not working) }
source share