After playing with Form.EventObserver for a while, I wonder if it shouldn't pass the element that triggered the event to the callback instead of the form object itself. Although we pass the form object to the constructor, we are monitoring changes of individual elements. As it stands, there isn't any way to determine which element fired the event without comparing current data to previous data.

I just can't see the case where it's more important to know the form element. You could just pass the Event object itself (which would be much more useful) and easily
get both the Form element or the element that triggered the event.

Event.element(event); //Gets the event that fired the callback
Event.findElement(event, 'form'); //Gets the form whose element triggered the event

Am I just misinformed about Form.EventObserver?

Thanks,
 -Justin Palmer

----------------------------------------------
Encytemedia.com
Professional User Interface Design for Rails Applications

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to