Re: [QFC] applyDefaults and its behaviour ?
| From: | Justin Patrin | Date: | Fri, 20 Jan 2006 15:49:13 +0000 |
| Subject: | Re: [QFC] applyDefaults and its behaviour ? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41014@lists.php.net to get a copy of this message | ||
On 1/20/06, Laurent Laville <pear@laurent-laville.org> wrote:
> Hello Alexey
>
> Working on a GUI frontend for PEAR_PackageFileManager2 with
> HTML_QuickForm_Controller (1.0.5), i've realized that i can't implement
> a real RESET function with QFC->applyDefaults() method.
>
> I'm expected to have this behavior:
>
> Fill page N of QFC, jump to another page, and then back to page N.
> Click on RESET button (that will call a QFC Action running
> QFC->applyDefaults()) and retrieve all defaults values of page N.
>
> I've noticed that it's not the case.
>
> RESET button work fine when i've not yet jump to another page (data are
> not yet submitted).
> But when i've jump once (data submitted) it no more possible to retrieve
> defaults values.
>
> I think it's due to code implementation of
> element.php,v 1.33 2005/06/24 17:58:29 avb (into QuickForm 3.2.5)
> onQuickFormEvent() method
> case 'updateValue':
> apply constant first, then if not, try to apply submit values, and if
> not apply defaults values.
>
> This behaviour is good for normal situation but not with a RESET button
> as i expect to have ?
>
> I hope i'm not wrong, and don't disturb you for nothing: i didn't yet
> found a thread about this topic on archives !
>
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