Question: All is in the title.

I get the URL param :

```
$log = $request->getParameter('logement');

```

Widget's statement :

```
$this->widgetSchema['logement'] = new sfWidgetFormInputText();

```

And I pass it in the form to prefill my widget 'logement' :

```
$this->form = new bailForm(array('logement' => $log));

```

I have read it in symfony's doc, but, when I do this, I have this error :

```
The "BailForm" form only accepts a "Bail" object.

```

I have already tried many things found on Internet but, no one works.

**EDIT**

The ORM is Doctrine
"Logement" is an attribute of "Bail" 

**EDIT 2**

I have tried :

```
$log = $request->getParameter('logement');

$this->form = new bailForm(null, array('logement' => $log));

```

I don't have error, but my widget "logement" isn't filled...

Answer: 
Your form is a propel or doctrine form, the first parameter of the constructor has to be a linked object instance. Try this:

```
$this->form = new bailForm(null, array('logement' => $log));

```
```
class QuestionsForm extends BaseForm
{

  private static $email;

  public static function setEmail($set) { self::$email = $set; }
  public static function getEmail() { return self::$email; }

  public function configure()
  {   

      $this->setDefault('email', self::$email); 
      //$this->setDefault('email', 'testemail'); 

      //rest of the form setup code
  }

}

```

Here is the actions class

```
class questionsActions extends sfActions
{
  public function executeIndex(sfWebRequest $request)
  {

    $this->email = $this->getRequestParameter('email');

    QuestionsForm::setEmail($this->email);
    //die(QuestionsForm::getEmail());
    $f = new QuestionsForm();

    $this->form = $f;

```