FormBuilder and SubForms with reverseLinks?

From: Date: Mon, 31 Oct 2005 17:41:57 +0000
Subject: FormBuilder and SubForms with reverseLinks?
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-21719@lists.php.net to get a copy of this message
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

« previous php.pear.general (#21719) next »