Hello,

I have an sfWidgetDoctrineChoice() form that I am trying to set the
default value for. The value I have is the id (primary key) of the row
I want to set to the default. It's being passed in as an option to the
form.

Here is my code:

 public function configure()
  {

   ....

         $preselect_review_id = $this-
>getOption('preselect_review_id');


         $this->widgetSchema['review_id'] = new
sfWidgetFormDoctrineChoice(array('model' => 'ReviewsSimpleView',
'add_empty' => false, 'order_by'=> array('review_name','asc')));

        if ($preselect_review_id != NULL){
                $this->setDefault('review_id', $preselect_review_id);
        }
    ...

   }

I've been able to see that $preselect_review_id is correctly defined
as an integer and has the right value. I've tried changing the form to
multiple => false and also encapsulating $preselect_review_id in an
array, but neither seemed to work well.

I would welcome any insight,

Thank you,

Susan

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to