2009年5月5日星期二

[fw-mvc] 1-m relation into forms

Hello,

I am trying to make a form which would contain a record from one table (bsae table).

Now i got the problem how to add to that form editing capability for a dependent table (1-m), so multiple records for one record of base table.

What would be the possible approaches for this on Zend_Form (to allow edit/add/delete) the elements from dependent table ?

Some possible approaches:
1. add each element from dependent table as isArray (but then how i would render those multiple elements - for each value? by default would de rendered just one even if setDefault provides an array with values)
2. add each element with _, so: dependentfield1_1,
dependentfield1_2, aso
other ideas

Of course, on Javascript add/delete mroe dependent rows would be handled.

I am trying also to keep things simple.

How do you create such forms ?
--  Best regards, Cristian Bichis www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com

没有评论: