Jimmy Palmer
2008-Jan-02 23:24 UTC
observe_form misbehaving - requests processed out of order?
scenario: I used the observe_form to build a live search. It worked perfect until I loaded a large amount of data and tested it in a production environment. symptoms: when I am searching for ''john'' I type in ''j'', ''o'', ''h'', and then finally ''n''. The observe field goes through and sends me the correct values but then searches for only ''j'' at the end. possible reason: I think it is because the ''j'' request takes up more time then the full ''john'' and it still process that request, but it unfortunately processes them out of order. possible solution: create a hidden field that increments the requests. If I get a request back that is less than the current one I know not to process it. Any other ideas? Any hints on how I would implement this? I''ve got my javascript increment function and check function, but I''m not quite sure how to work this out with the observe_field. when would i fire these javascript functions off? thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ryan Bigg
2008-Jan-02 23:34 UTC
Re: observe_form misbehaving - requests processed out of order?
Set a frequency of around 500 on the observe_field. It''s calling the function on the letter j because that''s the first event that the field changes on. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jimmy Palmer
2008-Jan-02 23:44 UTC
Re: observe_form misbehaving - requests processed out of ord
Ryan Bigg wrote:> Set a frequency of around 500 on the observe_field. It''s calling the > function on the letter j because that''s the first event that the field > changes on.That would defeat the purpose of a live search. A live search responds to what is typed in the field. The observe field must be listening at a much smaller frequency than that. Example here: http://www.recentrambles.com/pragmatic/view/59 I should call the function with the letter j because, yes, it is the first event. the problem is that it takes longer and than the last request. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Greg Donald
2008-Jan-03 03:28 UTC
Re: observe_form misbehaving - requests processed out of order?
On 1/2/08, Jimmy Palmer <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> but I''m not quite sure how to > work this out with the observe_field. when would i fire these > javascript functions off?Here''s the important bits from one I have setup: Live Search: <%= text_field ''search'', ''term'', :size => 12 %> <div id="wait" style="display:none;">Wait!</div> <%= observe_field ''search_term'', :frequency => 1.0, :update => ''target_id'', :url => { :controller => ''search'', :action => ''search'' }, :with => "''search='' + escape(value)", :loading => "Element.show( ''wait'' );", :complete => "Element.hide( ''wait'' );" %> -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jimmy Palmer
2008-Jan-07 21:31 UTC
Re: observe_form misbehaving - requests processed out of ord
Again, I''m not sure if we are understanding the problem. I believe I am using the observe field correctly, but it appears that the requests are getting out of order. Has anyone seen this behavior? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---