I''ve seen a couple other people ask this type of question, but I haven''t yet seen a good response. If your remote page has a periodically_calls_remote function in it, to say give status over the course of a long action, how does one stop it and redirect to a new page at the end? I''ve tried doing a redirect in the action that the periodically_calls_remote function calls, however that results in the redirected page being rendered in the middle of my document. Is there any way to trigger it to stop, or force the page to redirect somewhere else? I''ve tried figuring out how the upload_progress control does it, but it seems to be doing some magic that I couldn''t quite work out. Anyone have any ideas? Charles Comstock _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Nope, yours is the first reply I have had about it at all. I think the upload helper does some sort of hack of sending a global javascript variable to make it stop. Not quite sure how they do it though. If you look at the code they are generating new javascript inside the controller. It would be really nice if you could just render a stop_periodically_calls_to_remote to the client at some point. Not really sure how to do that though. Charles Comstock On 12/12/05, Stuart Hungerford <stuart.hungerford-FCV4sgi5zeUQrrorzV6ljw@public.gmane.org> wrote:> > > > Hi Charles, > > Did you receive any useful replies to this question? I have > much the same issue. > > > Stu > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Charles Comstock wrote:> Nope, yours is the first reply I have had about it at all. I think the > upload helper does some sort of hack of sending a global javascript > variable to make it stop. Not quite sure how they do it though. If you > look at the code they are generating new javascript inside the > controller. It would be really nice if you could just render a > stop_periodically_calls_to_remote to the client at some point. Not > really sure how to do that though.I''ve sucessfully stopped AJAX calls in progress by assigning a global JS variable to the created Ajax.Updater/Ajax.Request class, then calling "delete" on that variable. Perhaps the same would work with periodically_call_remote and its PeriodicalExecuter class. i.e. var cycler = null; cycler = <%= periodically_call_remote(...) %> function stop_cycler() { if (cycler != null) delete cycler; } -- We develop, watch us RoR, in numbers too big to ignore.