Hi Bernhard!

Thanks to your reply I have solved the problem.
It really quite buried. I didn't find it because I searched for the
repopulation functionality assuming it is triggered somewhere in the
bind() method.
It's not.

For everyone interested:
It's actually triggered in the view when using the $form->render()
method. To be even more specific it's in the $form->offsetGet($name)
method that does the trick:

http://trac.symfony-project.org/browser/branches/1.2/lib/form/sfForm.class.php#L959

If the form is bound, it uses the supplied request values
(taintedValues) as values.

Does anyone know if there is graphical representation of the classes
and there relationships of the sfForm framework somewhere?

:-) Klemens





On 16 Jun., 22:45, Bernhard Schussek <[email protected]> wrote:
> Hi Klemens,
>
> It's a little buried, but when you get to it it's pretty easy.
>
> The relevant code is in sfForm::getFormFieldSchema(). In this method,
> the form field schema is created, which is, in fact, a list of form
> widgets bound to specific values. Here is an excerpt of
> lib/form/sfForm.class.php, line 1019:
>
>   public function getFormFieldSchema()
>   {
>     if (is_null($this->formFieldSchema))
>     {
>       $values = $this->isBound
>           ? $this->taintedValues
>           : array_merge($this->widgetSchema->getDefaults(), $this->defaults);
>
>       $this->formFieldSchema = new sfFormFieldSchema(
>           $this->widgetSchema, null, null, $values, $this->errorSchema);
>     }
>
>     return $this->formFieldSchema;
>   }
>
> As you can see, the tainted values are used in the form field schema
> if the form is already bound. Otherwise the default values are
> displayed.
>
> Hope it helps
>
> Bernhard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to