Ball, Donald A Jr \(Library\)
2007-Jan-31 23:09 UTC
Re: Dynamic selects won''t fire events in some cases
I had a similar problem with dynamic lists of checkboxes. It turned out to be a bug or misfeature in Prototype, actually. observe_field caches the last value to which the user set the field, and inhibits the observation event from firing unless the value was observed to change. Unfortunately, the cache isn''t updated or invalidated when the value is modified programatically. Fortunately, it''s fairly simple behavior to change in Prototype. I gotta run now and can''t post the patch I found, but will do so later unless someone beats me to it. - donald --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Stephen Gerstacker
2007-Feb-01 14:51 UTC
Re: Dynamic selects won''t fire events in some cases
Ah, I didn''t realize Prototype cached the last value. I uncommented the check (lines 2138 & 2141) and it works great. Thanks. Stephen Gerstacker -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Ball, Donald A Jr (Library) Sent: Wednesday, January 31, 2007 18:09 To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails] Re: Dynamic selects won''t fire events in some cases I had a similar problem with dynamic lists of checkboxes. It turned out to be a bug or misfeature in Prototype, actually. observe_field caches the last value to which the user set the field, and inhibits the observation event from firing unless the value was observed to change. Unfortunately, the cache isn''t updated or invalidated when the value is modified programatically. Fortunately, it''s fairly simple behavior to change in Prototype. I gotta run now and can''t post the patch I found, but will do so later unless someone beats me to it. - donald --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---