Skip Menu |

This queue is for tickets about the Maypole-FormBuilder CPAN distribution.

Report information
The Basics
Id: 14711
Status: new
Priority: 0/
Queue: Maypole-FormBuilder

People
Owner: Nobody in particular
Requestors: rmcclain [...] megapath.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.42
Fixed in: (no value)



Subject: custom fields setting for as_form
I noticed that I can't do request->as_form(fields => [ some fields ]). It just uses the fb_defaults. Is this by design? In M:F:Model, in the EDIT coderef, there is a line: $args->{fields} = [ $proto->edit_columns ], # $proto->related ]; Should that be an ||= instead?
Date: Mon, 26 Sep 2005 01:19:19 +0100
From: David Baird <dave.riverside [...] gmail.com>
To: bug-Maypole-FormBuilder [...] rt.cpan.org
Subject: Re: [cpan #14711] custom fields setting for as_form
RT-Send-Cc:
On 9/22/05, Guest via RT <bug-Maypole-FormBuilder@rt.cpan.org> wrote: Show quoted text
> > This message about Maypole-FormBuilder was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=14711 > > > I noticed that I can't do request->as_form(fields => [ some fields ]). It just uses the fb_defaults. Is this by design? >
Not intentionally, but I think it's wrong to specify options like this in the template. The problem is, the form is generated twice during a submission request - once to handle the submission (e.g. in do_edit), and then again in the template (if the action sends you back to the same template). Both these forms need to be as near as dammit identical, so as much as possible, you should funnel your form-buildng through setup_form_mode. Show quoted text
> In M:F:Model, in the EDIT coderef, there is a line: > $args->{fields} = [ $proto->edit_columns ], # $proto->related ]; > > Should that be an ||= instead? >
Remember you can define your own setup_form_mode() in your models and change things you don't like. I'm going to leave things like that as they are, to encourage users to put form configs in setup_form_mode(), but you can override it. d.