Hi everybody! I'm new to Mach-II, although I have some MVC experience
in other frameworks/languages, and I'm trying to get up to speed.  I
like the Forms custom tag library and the idea of databinding in
general, but the application I'm currently converting has some fairly
complicated edit forms (i.e. not a simple one-to-one correspondence
between widgets and data fields), and I'm wondering what the "right"
way to proceed is.  As a basic example of what I mean, the value of a
database field might get set to any of several different text boxes on
the form, depending on which radio button is selected.

In other frameworks there's the concept of an adapter that contains
the logic to bind an interface to an object in a complex way, but I'm
not sure how that fits into the "bean" paradigm, and I don't want to
just cling to what I know.

Should I forget about automatic binding in the form, and just process
the form fields manually as event args in the filters/listeners,
constructing a bean to save to the database on the fly?  Or should I
roll my own adapter and create two types of bean (e.g. MyRecord.cfc
containing the database structure, and then MyRecordFormFields.cfc
containing the structure of the form), then bind the latter to the
form and use it to build an instance of the former when it's time to
persist?  That's closer to what I'm used to, but it rubs me the wrong
way in CF.  On the other hand it would let me use automatic binding to
really simplify things at the view level.

Anyway, I'm just curious if there's a consensus on this kind of thing,
or what solutions other people have come up with.  Thanks!

-- 
You received this message because you are subscribed to Mach-II for CFML list.
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/mach-ii-for-coldfusion?hl=en

***New URLs as of April 29th, 2010***
SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/

Reply via email to