You need to add a validator for your widget - this will remove the
"unexpected extra form field" error.

Than maybe you'll need to add "addComponentTypeIdColumnQuery()" method
into you filter class to create your custom query for filtering.


On 5 kvě, 16:33, jaubry <[email protected]> wrote:
> Hi,
> I work on a module in admin (backend). I have admin-generated the
> backend.
> In my schema, the module is an object O1 (rights) that have a foreign
> key with a parent object O2 (components), and O2 have a foreign key
> with a parent object O3 (components).
> I want to display a filter in the O1 list (index) and the combobox
> must display the O3 values to filter the O1 list.
> I hope that I am clear...
>
> object "rights" contains "component_id"
> object "component" contains "component_type_id"
> object "component_type" contains "label"
>
> I want to stay in admin generated.
>
> In generator.yml, the filter/display has [ component_type_id ]
>
> In lib/filter/doctrine/formRightsFormFilter.class.php :
>
>         $this->widgetSchema['component_type_id'] = new
> sfWidgetFormChoice(array(
>                         'choices' =>
> Doctrine::getTable('ComponentType')->getComponentTypeChoice(),
>                         'label' => 'Component Type'
>         ));
> The getComponentTypeChoice is a function in ComponentTypeTable
>
> The index screen is ok.
> But when I try to filter the component type, I get an "Unexpected
> extra form field named "component-type_id"."
>
> I have tried to put my own method in the generator.yml / list /
> table_method : getRightsWithComponentType
> It has :
> public function getRightsWithComponentType(Doctrine_Query $q)
>   {
>     $rootAlias = $q->getRootAlias();
>     $q->leftJoin($rootAlias . '.Component c');
>     $q->leftJoin('c.ComponentType t');
>     return $q;
>   }
>
> I have tried many things but it cannot work.
>
> Please help !
> Don't tell me that I have to use my own methods and templates... :-))
>
> Thanks.
>
> Jerome
>
> --
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to