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: 
One of two ways:

**1. If you want to validate Logement**

```
$form = new BailForm(); //BailForm must have Logement validator set
$form->bind(array('logement' => $log) + $otherRequestParameters);
$form->updateObject(); //or save

```

**2. If you just want Logement set on the object**

```
$bail = new Bail();
$bail->Logement = $log;
$form = new BailForm($bail);

```
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));

```