[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-02-26 Thread BearState
Oh, One additional comment ... If I get clever and try to wait in a while loop for AjaxRequest to set a flag that it has completed, the browser complains that some script is attempting to make the browser to run slow, do you want to let it run? IE7. So no, I can't create a slick wait loop li

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-02-26 Thread T.J. Crowder
Hi, Rather than thinking of an Ajax request as a function call, think of it as a message you send out. Send it, then get on with other things, or just wait (where waiting is not a busy-wait where the user can't do anything). When you get a reply, deal with the reply. In this case, replies are

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-02-27 Thread ColinFine
On Feb 27, 6:21 am, "T.J. Crowder" wrote: > Hi, > > Rather than thinking of an Ajax request as a function call, think of > it as a message you send out.  Send it, then get on with other things, > or just wait (where waiting is not a busy-wait where the user can't do > anything).  When you get a

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-02-27 Thread T.J. Crowder
> T.J., while I absolutely agree with what you have said, I think you're > missing part of BearState's question: Thanks, Colin. On first read, I thought he meant some knucklehead *programmers* might think it was a bug *in Prototype*. But I think you're right. And yes, simply displaying somethi

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-02-27 Thread BearState
Thanks for the feedback, I appreciate it.True, it would be nice to have a progress indicator. But I also said that the delay was not long, but long enough to be of consequence. Therefore, the progress indicator is not an issue. The issue is that the code is a modular response to a user cl

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-02-27 Thread T.J. Crowder
Hi, > No, the only real solution here, is to split the module at the point > of the Ajax.Request() call...Then, call the > remainder wrapped in a setTimeout(). Why not in the onSuccess of the Ajax.Request? That's what it's there for... You'll never get the timing right 100% of the time with s

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-02-28 Thread Tobie Langel
TJ, I think BearState is just missing the async nature of ajax. Best, Tobie On Feb 27, 11:17 pm, "T.J. Crowder" wrote: > Hi, > > > No, the only real solution here, is to split the module at the point > > of the Ajax.Request() call...Then,  call the > > remainder wrapped in a setTimeout(). > >

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-02-28 Thread Quleczka
> Why not in the onSuccess of the Ajax.Request?  That's what it's there > for...  You'll never get the timing right 100% of the time with > setTimeout. I guess BearState have a problem with situation like this for example: - you press submit in the form which call some function with ajax request

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-02-28 Thread Richard Quadling
2009/2/28 Tobie Langel : > > TJ, I think BearState is just missing the async nature of ajax. > > Best, > > Tobie > > On Feb 27, 11:17 pm, "T.J. Crowder" wrote: >> Hi, >> >> > No, the only real solution here, is to split the module at the point >> > of the Ajax.Request() call...Then,  call the >>

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Quleczka
Hi, > It does mean that if you have code further down the list of things to > do which is reliant on the result of the request, then it will have to > wait as well. > > So, that code would have to be part of the onSuccess too. > Hope this is understandable. I'm new to Ajax as well but I understa

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread T.J. Crowder
Hi, > How can I make this to DO NOT submit the form before ajax response > will come? There are a couple of ways you can do this. 1. Don't let them submit until the field is validated. When the user changes the field, as soon as they leave it (or even as soon as they change it) disable the sub

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Quleczka
Hi, Thanks for your reply. > There are a couple of ways you can do this. > > 1. Don't let them submit until the field is validated. : The point is I wanted to change my validation from dynamic (when user type or changes the fields) to on submit only :) > 2. Do the submit via XHR rather

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Quleczka
By the way if I don't find any other solution soon I'll use http://prototypejs.org/api/form/request probably to send entire form and return some result. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & scr

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Tobie Langel
> So my question is still open - is there any way to check something > with ajax request on submit and submit form when you have true/false > response? Yes. Use Event#stop to prevent default submit action. Fire an ajax request that does the validation. Show a "validating" indicator, upon receivi

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread T.J. Crowder
Hi, > The point is I wanted to change my validation from dynamic (when > user type or changes the fields) to on submit only :) :-) ! > Ok, I was thinking about this solution and using From.serialize but I > didn't want to my site to much - just simply change one thing - Option #2 can be a sm

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Quleczka
Hi, > Yes. Use Event#stop to prevent default submit action. Fire an ajax > request that does the validation. Show a "validating" indicator, upon > receiving the request back, just use $('my_form_id').submit() to > submit the form. Thanks for hint :) I was testing Event.stop but somehow I was th

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Quleczka
> Option #2 can be a smallish change, you don't need all the bells and > whistles. :-)  A very rough untested cut:http://pastie.org/403783 Thanks T.J. Your idea is similar to the one described above by Tobie. I've just missed the point that I can stop events earlier and add submit my form inside

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread BearState
Thanks for the advice folks, Using onSuccess is the ticket. BearState We live, we learn ( we get over the flu! ) On Mar 1, 7:21 am, Quleczka wrote: > > Option #2 can be a smallish change, you don't need all the bells and > > whistles. :-)  A very rough untested cut:http://pastie.org/403783 >

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread BearState
Woops! Take that back. It is NOT working right using onSuccess instead of setTimeout() over the split part of the module. Thought it was, but it was not. After having a hell of a time trying to dynamically plug the InPlaceEditor, I found out that onSuccess has little to do with successfully

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Quleczka
On 1 Mar, 22:38, BearState wrote: >I found out that onSuccess has little to do with > successfully returning anything from the script. What do you exactly mean by this? Quleczka --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-26 Thread Agile Consulting
Yes Thanks On Feb 27, 10:13 am, BearState wrote: > Hi, > > OK,  so Mr. Noob has made a lot of progress, but has found that when > he makes anAjax.Request(), the response is not set into the > javascript variables until after a certain amount of time, which > though small, is significant. > >

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-04-13 Thread Walter Lee Davis
onSuccess means about the same thing as a 200 header from the server. "Yes", it says, "the content is here where you asked for it, and I've sent it along your way. Hope you get it all eventually." onComplete, on the other hand, means "Here's your content; I've verified that you got all of

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-04-13 Thread T.J. Crowder
Walter, I don't think that's correct. The onSuccess callback is called when the XHR request has been fully completed (all data received), not when data receipt begins (XHR readyState 4, not XHR readyState 3). It's called only for successful requests (200 <= HTTP response code < 300), and only if

[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-04-13 Thread Walter Lee Davis
I've reviewed the source, and I agree--I'm wrong and TJ's right here. Walter On Apr 13, 2009, at 10:27 AM, T.J. Crowder wrote: > Walter, I don't think that's correct. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group