Re: [symfony-users] sfWidgetFormDoctrineChoice problems

2010-03-06 Thread Syam
You have to pass a Doctrine query to the widget, not a Doctrine collection. (Note the "Query" part in my getCampaignsQuery() table method example.) Samuel Morhaim wrote: Syam.. that didnt work it gives me an error. $query = Doctrine::getTable('Campaign')->getCampaigns(sfContext::getInstan

Re: [symfony-users] sfWidgetFormDoctrineChoice problems

2010-03-06 Thread Samuel Morhaim
Syam.. that didnt work it gives me an error. $query = Doctrine::getTable('Campaign')->getCampaigns(sfContext::getInstance()->getUser()->getGuardUser()->Organization); $this->widgetSchema['campaign_id'] = new sfWidgetFormDoctrineChoice(array ( 'model' => 'Campaign',

Re: [symfony-users] sfWidgetFormDoctrineChoice problems

2010-03-06 Thread Syam
Hi, You can use the sfWidgetFormDoctrineChoice widget with the 'query' option, thus, you can pass params to your query throught the form option system : *In action :* $this->form = new campaignForm($record, array('organization' => $user->organization) // or any param you want from $request o

[symfony-users] sfWidgetFormDoctrineChoice problems

2010-03-05 Thread Samuel Morhaim
I have a question, I have a dropdown that needs to be populated from the database, but with a query, and the query is based on a post variable. I know that sfWidgetFormDoctrineChoice has an option for passing a method, but I can't pass a method + parameter like that. So I used the simple sfWidget