I''m trying to change the event that triggers an observe_field on a input text, but I can''t get it working. Always respond to the "changed" event. My code is this: <%= observe_field "search", :frequency => 1, :update => "list", :url => {:action => "list"}, :with => "search", :on => "focus" %> Where is the error? PD: safari''s input search, is not supported by the observe_field helper? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey Javier, Javier Martinez a écrit :> I''m trying to change the event that triggers an observe_field on a > input text, but I can''t get it working. Always respond to the > "changed" event. > My code is this: > > <%= observe_field "search", > :frequency => 1, > :update => "list", > :url => {:action => "list"}, > :with => "search", > :on => "focus" %> > > Where is the error?If you use a non-zero :frequency option, you go for a time-based observer, not an event-based observer. Just remove the :frequency option. I should also stress that I''m not entirely sure it makes any sense to make an AJAX call on *focus*... What are you trying to achieve, ergonomy-wise? -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Was only a test. I will not use the focus event. I was testing the :on parameter, because I can not get working a input type search (I suppose that is not defined on the helper or something...) How can I attach the observer to an input type search? Thanks El 11/11/2006, a las 12:10, Christophe Porteneuve escribió:> > Hey Javier, > > Javier Martinez a écrit : >> I''m trying to change the event that triggers an observe_field on a >> input text, but I can''t get it working. Always respond to the >> "changed" event. >> My code is this: >> >> <%= observe_field "search", >> :frequency => 1, >> :update => "list", >> :url => {:action => "list"}, >> :with => "search", >> :on => "focus" %> >> >> Where is the error? > > If you use a non-zero :frequency option, you go for a time-based > observer, not an event-based observer. Just remove the :frequency > option. > > I should also stress that I''m not entirely sure it makes any sense to > make an AJAX call on *focus*... What are you trying to achieve, > ergonomy-wise? > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Javier Martinez a écrit :> Was only a test. I will not use the focus event. I was testing > the :on parameter, because I can not get working a input type search > (I suppose that is not defined on the helper or something...) > How can I attach the observer to an input type search?Actually, this should work from SVN: http://dev.rubyonrails.org/changeset/4873 If you don''t wish to use Edge, just grab its prototype.js (either from the trunk''s actionpack/lib/action_view/helpers/javascripts/ or from spinoffs'' prototype/, using a rake call to build prototype.js in dist/). -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey!! Thank you very much for this info!! El 11/11/2006, a las 12:53, Christophe Porteneuve escribió:> > Javier Martinez a écrit : >> Was only a test. I will not use the focus event. I was testing >> the :on parameter, because I can not get working a input type search >> (I suppose that is not defined on the helper or something...) >> How can I attach the observer to an input type search? > > Actually, this should work from SVN: > > http://dev.rubyonrails.org/changeset/4873 > > If you don''t wish to use Edge, just grab its prototype.js (either from > the trunk''s actionpack/lib/action_view/helpers/javascripts/ or from > spinoffs'' prototype/, using a rake call to build prototype.js in > dist/). > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---