-
1. Re: requestDelay with onsubmit
mpickell Apr 29, 2010 10:47 AM (in response to mpickell)Can anyone help me out on this? Is there a reason setting an onsumbit javascript function causes the requestDelay to stop working?
-
2. Re: requestDelay with onsubmit
ilya_shaikovsky Apr 29, 2010 11:48 AM (in response to mpickell)Can't reproduce. used
<a4j:support event="onkeyup" ignoreDupResponses="true" requestDelay="2000" ajaxSingle="true" reRender="repeater" onsubmit="alert(1);"/>
and after closing alert I see next output in a4j:log
RF 3.3.3 checked.debug[18:47:52,960]: New request added to queue 'j_id355:j_id358'. Queue similarityGroupingId changed to j_id355:j_id358debug[18:47:52,960]: Queue will wait 2000ms before submit -
3. Re: requestDelay with onsubmit
mpickell Apr 29, 2010 4:20 PM (in response to ilya_shaikovsky)ok, I used the debugger and the requestDelay is working correctly. What the problem is then is that the ON_SUBMIT function is calling immediately when the first onkeyup event occurs.
Is this correct, or should the on_submit wait until AFTER the request delay?
so I would expect that the on_submit would not trigger until this line in the log:
debug[16:13:50,256]: Queue 'DEFAULT_EVENT_QUEUE' will submit request NOW
-
4. Re: requestDelay with onsubmit
mpickell Apr 29, 2010 4:34 PM (in response to mpickell)wait.. my onkeyup event was getting setup somehow.. so that is what is doing it.
In firebug I see that the A4J.AJAX.Submit(...) call contains the 'oncomplete' javascript, but the javascript i set up for 'onsubmit' is moved to the input box's 'onkeyup' field?
-
5. Re: requestDelay with onsubmit
ilya_shaikovsky Apr 30, 2010 6:15 AM (in response to mpickell)it's correct and works in this way by design. as you could process for example button or link click with onclick - you could do the same with support but onsubmit will be hadnled in on<supportEvent> and only if not canceled - will go to queue and then waits delays and so on.
-
6. Re: requestDelay with onsubmit
mpickell Apr 30, 2010 8:20 AM (in response to ilya_shaikovsky)Thanks Ilya, I understand it now.
Is there a way to trigger an event on the actual submit AFTER the delay? If not built in, do you have any suggestions on how I might do it?
-
7. Re: requestDelay with onsubmit
ilya_shaikovsky Apr 30, 2010 12:45 PM (in response to mpickell)the only option unfortunatelly is use onsubmit on queue. But unfortunatelly if you have to cancel the event - it's not possible with that handler, and the second - it will be called for all requests in that queue.
-
8. Re: requestDelay with onsubmit
ilya_shaikovsky Apr 30, 2010 12:45 PM (in response to ilya_shaikovsky)sorry, checked once more.. bad news - onsubmit in queue calledright after the request sent.. :/
-
9. Re: requestDelay with onsubmit
mpickell Apr 30, 2010 1:03 PM (in response to ilya_shaikovsky)ok, maybe i can work around it somehow using the status component... or some javascript to watch for the actual submit.
Thanks for your help.
-
10. Re: requestDelay with onsubmit
mpickell May 5, 2010 7:55 AM (in response to mpickell)Not sure why i didn't think of it, but what I was looking for here was solved with this post: http://community.jboss.org/thread/151530?tstart=0
The onstart event on the status component waits until after the responseDelay
-
11. Re: requestDelay with onsubmit
ilya_shaikovsky May 5, 2010 8:09 AM (in response to mpickell)It's a shame but digging into the ajax script - forgot about simplest soolution also