Implementing DRY Forms

Posted by virtualeyes on Stack Overflow See other posts from Stack Overflow or by virtualeyes
Published on 2012-06-11T08:22:15Z Indexed on 2012/06/11 16:40 UTC
Read the original article Hit count: 251

Filed under:
|
|

Getting into Play 2.0, overall, blown away, great stuff.

Anyway, wondering how one can achieve DRY forms in Play? If you look at the create & edit examples in the Computer Database Sample, you'll see that the form elements are repeated. With just 4 fields (in the sample form), no big deal, but when you're dealing with large, complex forms and/or handling many CRUD models, the duplication becomes a bigger maintenance issue.

On the binding end ( form.bindFromRequest and form.fill(Foo) ), the implementation is so elegant for create/edit operations; is there a corresponding solution in the template layer?

© Stack Overflow or respective owner

Related posts about forms

Related posts about dry