2 Replies Latest reply on Apr 15, 2008 8:57 PM by Mark Fleschler

    Rapidly clicking A4J links or buttons crashes Seam

    Mark Fleschler Newbie

      I posted this earlier in the JBoss A4J forum, but I determined that this is more of a Seam issue and this is a better place to ask for help.

      I've been running into an issue that is consistently showing up across our entire application where ever we are using A4J. If you rapidly click on an A4J command link or button a bunch of times, after around the 6th or 8th click, I end up with a null pointer exception which is caused by the controller's binding's not being recognized when accessed in the xhtml.

      I explored a couple options first, specifically two A4J attributes:

      - ignoreDupResponses
      - eventsQueue

      These were culled from this  thread:

      Neither of these suppressed my requests sufficiently or prevented my seam controller from being deserialized each time a request was sent. Eventually it seems that when trying to rerender the 5th or 6th request, the controller instance hasn't been established yet for that request and I end up with an NPE. For the former attribute, I just set it to true. For the latter, I just gave it an arbitrary hard coded string attribute (which I am assuming would need to be unique for each A4J link).  I did discover that these both manage the response and will not properly prevent Seam from processing my rapid fire requests.

      Is there a way we can globally prevent requests from processing from a particular A4J link until it's finished with any existing requests? We are exploring a short term solution of disabling the onclick of the element utilizing A4J while its processing and restoring upon completion via Javascript. Is there a bug in Seam that would help explain why the controller's not initializing in time? Perhaps it should block A4J request processing until the controller's ready. Big thanks in advance for any of your help.