| Brett Bieber 2005-10-31, 6:59 pm |
| DB_DataObject_FormBuilder and SubForms -
Is there an easy way to automatically create subForms for tables that
reverseLink back to the main table?
The example in the documentation refers to a table for [gender] and a table
for [people]. The table [people] holds the gender_id for a record in the
[gender] database. This allows you to show a list of people linked to that
[gender].gender_id when you use fb to build a form for [gender] and are
editing a record.
I'd like to see reverseLinks taken a step further by generating subForms for
the reverseLinks. The gender example doesn't suit this well because the
people table would obviously be larger than gender --- so lets say we have
the table [people] and a table [cars] to store the cars that people own.
This is a 1-n, one to many, relationship with people->cars.
We can manually add in a subForm element for the cars - but would it be
possible for formbuilder to do this automatically? The
database.links.iniknows which field holds the foreign key (something
like [cars] people_id =
people:people_id in this case), and formbuilder would just have to create a
new formbuilder element and add a subform for each car by the foreign key....
(and also invoke the processForm for each generated subForm).
Is this possible with FormBuilder, and would others find this as a useful
feature? Or should we just continue handling all of this manually for each
instance where I have a reverse linked record?
JustinP, I'm informally posing this question to you, as I'm sure you've come
across this before.
--
-Brett
http:saltybeagle.com <http://saltybeagle.com> aim:ianswerq
|