Note that there are some explanatory texts on larger screens.

plurals
  1. POCancellation of Ajax Request in RichFaces
    primarykey
    data
    text
    <p>I have issue with canceling Ajax Request. Our application interface is build in RF.</p> <p>On the progress bar modal there should be cancel button - that interupt current operation, for example cancel filling controls from database. How to make it?</p> <p>I tried using reloading page, flags with "if" conditions on getters for controls and also using "bypassUpdates" with no positive effects.</p> <p>Thanks in advance for your help</p> <p>XHTML (Button):</p> <pre><code>&lt;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}"/&gt; </code></pre> <p>JAVA: (Button):</p> <pre><code>public void actionShow(ActionEvent evt) { //Some logic, getting data from database } </code></pre> <p>XHTML (Main Page - showing wait Popup)</p> <pre><code>&lt;a4j:form&gt; &lt;a4j:status id="ajaxStat" onstart="Richfaces.showModalPanel('waitPanel');" onstop="#{rich:component('waitPanel')}.hide()" /&gt; &lt;/a4j:form&gt; </code></pre> <p>XHTML (Popup):</p> <pre><code>&lt;rich:modalPanel id="waitPanel" autosized="true" moveable="false" minWidth="250" styleClass="popup"&gt; &lt;f:facet name="header"&gt; &lt;h:panelGroup&gt; &lt;h:outputText value="Operation in progress"&gt;&lt;/h:outputText&gt; &lt;/h:panelGroup&gt; &lt;/f:facet&gt; &lt;f:facet name="controls"&gt; &lt;h:panelGroup&gt; &lt;h:graphicImage value="../images/icons/action_close.gif" styleClass="hidelink" id="hidelink"/&gt; &lt;rich:componentControl for="waitPanel" attachTo="hidelink" operation="hide" event="onclick"/&gt; &lt;/h:panelGroup&gt; &lt;/f:facet&gt; &lt;a4j:form id="msgFrm" ajaxSubmit="true"&gt; &lt;h:outputText value="Please wait..."/&gt; &lt;h:graphicImage styleClass="progressBar" value="../images/indicatorbar.gif"/&gt; &lt;a4j:commandButton value="Cancel" type="button" onclick="#{rich:component('waitPanel')}.hide()" action="#{main.cancelAction}" bypassUpdates="true"/&gt; &lt;/a4j:form&gt; &lt;/rich:modalPanel&gt; </code></pre> <p>JAVA (Popup):</p> <pre><code>public void cancelAction(){ //there was setter for true/false flag for actionShow() here, now there is nothing here (it was not working) } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload