[html-formfu] Config generator
Zbigniew Lukasiak
zzbbyy at gmail.com
Fri Mar 14 07:57:50 GMT 2008
On Thu, Mar 13, 2008 at 11:01 PM, Byron Young <Byron.Young at riverbed.com> wrote:
>
> Zbigniew Lukasiak wrote:
> > On Thu, Mar 13, 2008 at 10:24 PM, Byron Young
> > <Byron.Young at riverbed.com> wrote:
> >> Zbigniew Lukasiak wrote:
> >> > Hi there,
> >> >
> >> > I've made a new version of the config generator - see the
> >> attachment.
> >>
> >> Hey Zbigniew,
> >>
> >> I think it's very useful. Thanks!
> >>
> >> However, I think I've found a problem with how it handles
> > belongs_to relationships. In my [very limited] usage of
> > HTML::FormFu, belongs_to ought to be represented with a
> > Block, like so:
> >>
> >> - type: Block
> >> elements:
> >> - type: Select
> >> name: belongs_to
> >> label: Belong_to
> >> attributes:
> >> title: Pick something from the other table
> >> model_config: DBIC:
> >> model: DB::ForeignTable
> >>
> >>
> >> Instead, your generator creates a Repeatable, which seems
> > to me to only make sense in the has_many case (or
> > many_to_many), since with belongs_to you can only have one
> > item from the foreign table.
> >>
> >> Are my assumptions wrong? Since I am a FormFu noob, I
> > wouldn't be surprised if the way I'm using it is not standard
> > convention.
> >
> > Certainly this is not a finished product yet. With belongs_to I have
> > a problem - because there are two logical configs for it - it can be a
> > Select like yours (I ton't think it needs the outer Block in that
>
> Oh, cool, I didn't know that.
>
>
> > case) - but it can also be a nested Block with multiple elements that
> > would let you change the values in the record that is the 'owner' of
> > the original one. I think the Select would be the more popular
> > arrangement - so for the first version I'll do that - but what should
> > be the best way to cope with that? A config option for the config
> > generator? Maybe output both and let the user delete the one that is
> > not needed? Or maybe 'comment out' the less popular option?
> >
>
> Hmm, tough call. I would be happy with both so I can comment out the one I don't want.
OK - I've just committed a fix for generating the Select box for
belongs_to. It is in the svn at:
https://html-formfu.googlecode.com/svn/trunk/HTML-FormFu-ConfigGenerator
Check it out.
Cheers,
Zbigniew Lukasiak
http://perlalchemy.blogspot.com/
More information about the HTML-FormFu
mailing list