[symfony-users] sfWidgetFormDoctrineChoice creates blank row when editing

2011-03-24 Thread Growiel
Hi. In every symfony 1.4 form I have, I have a problem when I use sfWidgetFormDoctrineChoice. If i enable the add_empty option, I do have an empty choice at the top of my list. Then problem is that if I choose it (let's say I don't want to associate an item anymore), it will create an empty row

[symfony-users] sfWidgetFormDoctrineChoice with i18n and order by

2011-03-08 Thread Marek
Hi, I have a translated model Country and I need to display drop down ordered by translated field 'name'. 'order_by' option does not work with translated fields, so I have to use 'query' option: $this-setWidget('country_id', new sfWidgetFormDoctrineChoice( array('model' = 'Country',

[symfony-users] sfWidgetFormDoctrineChoice to show non-multi selectable list

2010-09-18 Thread Martin Henits
Hi, I was wondering if anyone knows how to use sfWidgetFormDoctrineChoice to display a non-multi selectable list? I don't want to see a drop-down menu. I want to see a list of options in a box. Also I don't want to set the multiple option as true. any clue? thanks a lot -- If you want to

Re: [symfony-users] sfWidgetFormDoctrineChoice to show non-multi selectable list

2010-09-18 Thread Daniel Lohse
You mean a normal list of radio buttons, right? Just set the 'expanded' option to true and the 'multiple' option to false and you should be golden. Cheers, Daniel Sent from my iPhone4 On Sep 18, 2010, at 5:57 PM, Martin Henits martin.hen...@gmail.com wrote: Hi, I was wondering if anyone

[symfony-users] sfWidgetFormDoctrineChoice display lookup of a lookup

2010-09-03 Thread Jochen Daum
Hi, I got a table scheme which can be shortened to this: Person: columns: id: { type: integer(4), notnull: true, unique: true, primary: true, autoincrement: true } user_id: { type: integer(20) } name: { type: string(100), notnull: true } contract_id: { type: integer(4) }

[symfony-users] sfWidgetFormDoctrineChoice problem

2010-08-25 Thread Andro Fumero
Hi there, Does anyone tried to limit the result of dropdown to only 1? or atleast just keep the dropdown hidden with selected value? I already set the id of the following dropdown, and i dont need to show other choices anymore. public function executeNew(sfWebRequest $request) {

Re: [symfony-users] sfWidgetFormDoctrineChoice problem

2010-08-25 Thread Gustavo Adrian
The dropdown must show every available choice, regardless an option is already selected or not (What would you do if you need to update an item and you want to change that value?). If you need to show only the option selected, you could change the table method used by the widget to change the list

[symfony-users] sfWidgetFormDoctrineChoice problem

2010-08-24 Thread Andro Fumero
Hi there, Does anyone tried to limit the result of dropdown to only 1? or atleast just keep the dropdown hidden with selected value? I already set the id of the following dropdown, and i dont need to show other choices anymore. public function executeNew(sfWebRequest $request) {

[symfony-users] sfWidgetFormDoctrineChoice problem

2010-04-27 Thread Andro Fumero
This is from users BaseForm. 'profileid' = new sfWidgetFormDoctrineChoice(array('model' = $this-getRelatedModelName('Profile'), 'add_empty' = false)), its displaying the Description column of my profile table. how can i display the profile column in my Profile table ? Can any one.? Thanks

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

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
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 =

[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

[symfony-users] sfWidgetFormDoctrineChoice and ajax callback to manage dependecy fields

2010-02-02 Thread adrianrz
Hello, I have a form definition $this-setWidgets(array( 'razonsocial' = new sfWidgetFormInputText(), 'nombre'= new sfWidgetFormInputText(), 'direccion' = new sfWidgetFormInputText(), 'provincia_id' = new sfWidgetFormDoctrineChoice(array('model' =

[symfony-users] sfWidgetFormDoctrineChoice

2010-01-07 Thread l3ia-etu
hello, i would like to change the widget: //$this-widgetSchema['type'] = new sfWidgetFormChoice(array ('choices' = Doctrine::getTable('JobeetJob')-getTypes(),'expanded' = true)); to have a combo box instead of radio buttons, so i use: $this-widgetSchema['type'] = new

Re: [symfony-users] sfWidgetFormDoctrineChoice

2010-01-07 Thread Daniel Lohse
Don't change the widget at all, it's not needed! Just change 'expanded' = true to 'expanded' = false and you have your combo box. Cheers, Daniel On Jan 7, 2010, at 1:09 PM, l3ia-etu wrote: hello, i would like to change the widget: // $this-widgetSchema['type'] = new

[symfony-users] sfWidgetFormDoctrineChoice render with value

2009-12-11 Thread smellycat37
Bonjour, j'ai un form $this-setWidgets(array( 'product_id' = new sfWidgetFormDoctrineChoice(array('model' = 'Product')), )); $this-getWidget('product_id')-setOption('order_by', array ('name', 'ASC')); $this-setValidators(array( 'product_id' = new

Re: [symfony-users] sfWidgetFormDoctrineChoice render with value

2009-12-11 Thread Alexandre Salomé
You must use the default or bind a value to your form, not render it with the value attribute. With default value : public function configure() { $this-setDefault('field_name', 'default value'); } Or when binding : $form-bind(array ( 'field_name' = 'value' )); Alexandre 2009/12/11

[symfony-users] sfWidgetFormDoctrineChoice - parameters for table_method

2009-09-15 Thread andrea cecchetto
Hi guys, I need to pass some parameters to Option table_method on sfWidgetFormDoctrineChoice. Something like this 'l' = new sfWidgetFormDoctrineChoice( array( 'model' = 'Categoria', 'add_empty' = ' ',

[symfony-users] sfWidgetFormDoctrineChoice with i18n

2009-08-16 Thread afilina
I have a model generated with Doctrine named Product that has i18n. Now I need to use the list of products as a dropdown in my form. I use sfWidgetFormDoctrineChoice. This works great: I specify the model name and it does everything for me. It even gets the name of the product based on the

[symfony-users] SfWidgetFormDoctrineChoice - how do you filter values

2009-03-24 Thread fredlab
Hey, Imagine I have the following : $w = new sfWidgetFormDoctrineChoice(array( 'model' = 'Codetype', 'add_empty' = false, )); Where table codetype has : id, codetype, value Example of the table is : id |codetype| value 1 book