Christophe Porteneuve wrote:
> Steve Prior a écrit :
>> pieces are pretty simple.  How about refactoring this code out into a 
>> dynamic form builder which can take an existing element, save the old 
>> contents, and fill it with some form variants (simple text field, pull 
>> down selector, <insert your idea here>.  This would be amazingly useful!
> 
> The onFormCustomization callback lets you easily inject extra fields in 
> the form, although removing the text-based editor will likely break some 
> stuff.
> 
> As the rewriter of IPE back in May, I'm interested in the ideas out 
> there, although we have to draw the line somewhere, or we'll end like 
> Apache: being all to all, but being bloated for specific cases.  Plus, 
> the tests alone would become way unwieldy.
> 

Well for starters the new IPE doesn't handle the cancel button 
"correctly" when htmlResponse is false.  I think cancel should restore 
what was there before the edit started, and that doesn't happen.  I 
wrote a patch and think I posted it to the list, but never got any 
response on that.

I still think that the existing code from IPE could be refactored out to 
  expose the dynamic form building capability and that this would be 
both useful on its own and could still be used by IPE without bloating 
anything.  The dynamic form building piece would have methods for build, 
takedown, and restore old contents.  Then the IPE itself would use that 
and manage the submission of the request and the breakout would make the 
code more readable/modular.  Without making the code more bloated I 
think that this division would make it more easy if someone wanted to 
override the current editor with the example pull down selector I 
mentioned - the form builder part would need to be overridden, but maybe 
the rest of the IPE code could be reused.  With the current 
implementation a selector editor control wouldn't be able to share 
common code with the IPE.

An interesting exercise would be to see if the onFormCustomization from 
above would naturally move to the form building class or would it stay 
in IPE itself.

Steve

--~--~---------~--~----~------------~-------~--~----~
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