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
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',
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
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
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) }
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)
{
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
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)
{
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
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
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',
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 =
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
Hello,
I have a form definition
$this-setWidgets(array(
'razonsocial' = new sfWidgetFormInputText(),
'nombre'= new sfWidgetFormInputText(),
'direccion' = new sfWidgetFormInputText(),
'provincia_id' = new sfWidgetFormDoctrineChoice(array('model'
=
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
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
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
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
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' = ' ',
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
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
21 matches
Mail list logo