سؤال

We're upgrading from Richfaces 3.3 to Richfaces 4.2. We were using the oncomplete attribute on the a4j:queue component to remap our JavaScript controllers after Ajax requests. After upgrading, the oncomplete attribute no longer works. It appears to not be supported in Richfaces 4.x.

The code looks something like this:

<a4j:queue requestDelay="500" oncomplete="alert('1')" />
<h:form>
<h:commandLink value="Common link">
<a4j:ajax />
</h:commandLink>
</h:form>

There are a number of open issues in the Richfaces issue tracker related to this issue:

My question is, is there a way to workaround the removal of the oncomplete attribute from the a4j:queue component? We'd like to re-bind our JavaScript controllers after all of the Ajax requests have completed. It seems like we're not the only folks to encounter this issue. I'm curious about how others have worked around the change.

هل كانت مفيدة؟

المحلول

Here's what we finally settled on.

We already had an a4j:status element that we were using to display the little spinner that displays while AJAX requests are being handled. We remap our controllers in the onstop element on the a4j:status element.

    <a4j:status onstop="alert('1');">
        <f:facet name="start">
            <div id="throbber" class="throbber-visible">Loading...</div>
        </f:facet>
    </a4j:status>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top