Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.


In reply to Re^2: Choosing a Catalyst form widget by mattr
in thread Choosing a Catalyst form widget by mattr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (8)
As of 2024-03-28 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found