Re: [QFC] applyDefaults and its behaviour ?
| From: | Justin Patrin | Date: | Fri, 20 Jan 2006 16:07:17 +0000 |
| Subject: | Re: [QFC] applyDefaults and its behaviour ? | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41016@lists.php.net to get a copy of this message | ||
On 1/20/06, Laurent Laville <pear@laurent-laville.org> wrote:
>
> Justin Patrin a écrit :
> > Defaults are defaults. They are the lowest level in the chain.
> > Constants and submitted values override them. If you need to override
> > submited values you have to do something special, such as setConstants
> > when displaying the form (as long as you don't use setConstants when
> > processing it should be fine).
> >
> > Or, probably a better solution, simply rewrite the values stored in
> > QFC's data store.
> >
> > --
> > Justin Patrin
> >
> >
> As you said it yourself, defaults are defaults.
> But if you consider standard reset button of html form, you can retrieve
> the old values (defaults) before to submit
> a form. Easy if you made a mistake and want to rollback.
>
> I'm expected a such behaviour for my RESET button:
>
> Your idea of rewrite values stored in QFC data store is a solution, but
> its a private solution.
> Perharps we could think of a general solution that can be share and
> reuse in any situation ?
>
As I said, defaults are defaults. That's how they work, so setDefaults
isn't going to work for you for resetting. I suggest asking the QF
authors for a resetToDefaults() function and then asking the QFC
authors to add their own function which calls this.
--
Justin Patrin