[Catalyst] Re: State ofthe art in form valid =?WINDOWS-1252?Q?ation;_opinion_poll=85_Model_based_forms/validation=3F?=

Bill Moseley moseley at hank.org
Thu Dec 6 15:13:16 GMT 2007


On Thu, Dec 06, 2007 at 03:26:06PM +0200, Valentin Tumarkin wrote:
> I would love to see a single "Form" framework which can be used both
> for HTML and AJAX forms (JSON data).  Imagine having the View (and not
> the Controller) decide how the form will be presented - as HTML or
> ExtJS widgets.

Isn't that how Catalyst works already?

When processing my forms the code has no idea if it was submitted via
AJAX or standard post.  And in the cases where a controller is shared
between AJAX non-AJAX requests the controller typically doesn't know
what the final output will be.

For example, my main template dispatcher knows to not wrap a template
in the site's layout if the request is an AJAX request.  And the view
knows to generate JSON vs.  html, as well.

Indeed, for simple partial page updates via AJAX (sorting, paging)
turning off javascript results in almost all the same code executing.

If I was to start over I might be more inclined to use
Catalyst::Action::REST as described in:

    http://catalyst.perl.org/calendar/2006/9
    http://catalyst.perl.org/calendar/2007/2

Although, I'm not sure I it can ever be that simple when it comes to
coding the real application.  In general the stash that's needed for
the html template isn't always the same one to expose in JSON or XMLRPC
responses.



-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list