-
1. Re: EventsQueue and Concurrent call to conversation
niox.nikospara.yahoo.com Jan 18, 2010 11:43 AM (in response to faffinito)Hello,
I do not know how to enforce the correct behaviour to the server, but I suggest some client-side action.
1) Something like:
<a:commandLink ... onclick="return ajaxStarted(this)" oncomplete="ajaxEnded(this)" />
Where: ajaxStarted() checks if an AJAX request is active on this link, and returns false if there is (so no second request is issued).
ajaxEnded() marks that no AJAX request is active on this link, so any further may be issued again. If you used a button instead of link, JS-disabling it would also provide a visual cue to the user.
A simplistic implementation with jQuery using the CSS class to mark AJAX activity:
function ajaxStarted(x) { x = jQuery(x); if( x.hasClass("ajax") ) { // AJAX request active, stop processing return false; } else { // mark AJAX activity x.addClass("ajax"); return true; } } function ajaxEnded(x) { jQuery(x).removeClass("ajax"); }
2) Use an AJAX indicator to notify the user of AJAX activity. You could achieve this with the ajax CSS class above, or with some additions to ajaxStarted(), ajaxEnded(). Richfaces has an AJAX indicator component, which I don't like; why bother the server with pure client-side stuff?
-
2. Re: EventsQueue and Concurrent call to conversation
lvdberg Jan 22, 2010 9:51 AM (in response to faffinito)Hi,
this not really a Seam question/problem, but has to do with configuring correctly the queue and the buttons. Most of them are nicely explained in the documentation under chapter 7.12, there you can see how to configure the stuuf to prevent these errors. You should basically throw-away all new request, while the old one is not yet processed.
When you use and configure ajax-4-JSF correctly there is really no need to use additional clinet side scripyomg.
Leo