On Saturday 16 December 2006 18:27, Ryan Gahl wrote:
> Create widget classes that encapsulate their own Ajax needs (i.e.
> autonomous controls that handle their own html refreshing), and when
> one redraws itself, re-attaches its own behaviors as needed. Each
> widget can be viewed as its own mini-page.

I'm not convinced that approach will work in general. A concrete case I 
have in mind is this:

I have a form where some input elements (kind as well as content) depend 
on the choices in other elements. Depending on what the user enters 
into the form, the dependent elements are updated by means of ajax 
requests. Also, the elements are continuously monitored by a purely 
client-side validator and immediately notify the user of invalid input.

Unfortunately, these two concerns, dynamic form update and continuous 
validation, cut across each other. At the moment, they are blissfully 
ignorant of each other and that's how it ideally should be. The 
drawback is that dynamically (ex)changed input elements are not hooked 
into the validator.

The solution you suggest would, in my understanding, engender that I 
replace the simplicity of <%= f.text_field :last_name %> with a 
client-side framework managing components -- "widgets". Widgets would 
be anything but simple, instead they would have to fulfill several 
contractual obligations for playing nicely with their encompassing 
framework, such as sending and receiving life-cycle events. In such an 
environment it would certainly be possible to keep the concerns I 
mention above separated, but at a huge cost of developing the 
infrastructure first.

I certainly agree that it would be great to have a (standard) 
client-side component framework integrated with Rails. However, this is 
not the case, yet, and I'm very reluctant to stumble in that direction 
on my own.

For what it's worth, there is a project aiming at integrating Dojo with 
Rails: http://rubyforge.org/projects/rojo/
I asked Alex Garrett about it at the beginning of August. He was then 
targetting end of August for a first release and mid October for "very 
railsy dojo widget integration". I take it as indicative of the effort 
involved that there has not been any release yet.

Michael

-- 
Michael Schuerig
mailto:[EMAIL PROTECTED]
http://www.schuerig.de/michael/

--~--~---------~--~----~------------~-------~--~----~
 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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to