When the form is generated, it doesn't have the value that is filled  
in table_a_id.  It's before the data is even selected by the user.

What you would need to do is create dynamic data sets on the front end  
via javascript to load or change the values that are shown in the  
table_b_id select field.  However, this is possible if you pass in a  
preselected value for table_a_id.


..oO  David Wang  Oo..
..oO  blog  - http://www.udfi.biz
..oO  JennieBot - www.jenniebot.com - helping you be a better you!






On Aug 21, 2009, at 2:07 PM, Francisco Calderón wrote:

>
> Hi, im having some trouble with a select widget, i have 2 selects to
> fill, one from a different table
>
> i have a main_table and it have one field for each select, table_a_id
> and table_b_id,
>
> The problem is when i try to use that form to edit the one record from
> main_table, i fill the first one in the Form Class like this
>
> $this->widgetSchema['table_a_id'] = new sfWidgetFormPropelChoice(array
> (
>  'model' => 'TableA',
>  'add_empty' => true,
> ));
>
>
> it works fine, now i need to fill the other select with the data from
> the table_b asociated with the table_a, like this
>
> $this->widgetSchema['table_b_id'] = new sfWidgetFormPropelChoice(array
> (
>  'model' => 'TableB',
>  'add_empty' => true,
>  'criteria' => TableBPeer::getDataCriteria(1)
> ));
>
>
>
> TableBPeer::getDataCriteria() is wroking with the "1" but i need to
> send to that function the table_a_id value cause there is a relation
> between the table_a with table_b
>
> i've tried everything, things like this $this->widgetSchema['TableA']-
>> getValue() but nothing works, somebody knows how could i do this?
>
> Thanks in advance.
>
> Francisco Calderón
>
> >


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