http://qs321.pair.com?node_id=610573


in reply to Re: Choosing a Catalyst form widget
in thread Choosing a Catalyst form widget

Thanks. I started trying Catalyst::Controller::FormBuilder. I was stunned at how the YAML file suddenly made this beautiful form appear, with a JavaScript error message popping up; that alone is worth it perhaps. However I think the docs are a bit lacking, or maybe my first use of it is not one that is intended (first is a static form not based on an object in the database). Also I can't get css to target the form correctly.. Also I'm not quite sure if it is possible to get C::C::FB to render the form contents without editable fields, like a confirmation page, though it is not a deal-breaker. Probably rolling my own template would solve some of these issues..

Also thanks for the tip, I didn't realize it isn't really YAML they're using, though they do say "essentially YAML".

Also I found the pod code doesn't work for the simple static form I am making now that does not depend on the database; I think the edit() subroutine is not supposed to be used in this case perhaps. Just display cyclically with view() and then forward to save(). That is, the /edit url makes no form show, while the /view url displays an editable table. Perhaps edit() is meant to only work with a database object i.e. edit book id 5 with /edit/5, like in the CRUD tutorial.

I'll keep at it, but I'm a bit worried that the /view url is showing an editable form. I'd think /view should only display existing data not as an input form at all... but if so then will have to roll my own confirmation page template I suppose. Hmm, maybe I need to make a dummy module to site in the DB directory that holds my DBIx::Class? I didn't make this one using the catalyst_create.pl script, maybe this is the problem?

UPDATE: Successfully made a static form with Catalyst::Controller::FormBuilder. Only required defining fields in edit.fb, creating /view and /save subroutines, and creating templates for /view (which is about 1 line), /save (a for loop with table rows of field.label and field.value), and /error (dupe user name, etc. a stashed message). I think I'll see how this works out for the next stage of my project, too.