ShtumiUsefulBundle icon indicating copy to clipboard operation
ShtumiUsefulBundle copied to clipboard

Not working in form collections

Open carlescliment opened this issue 13 years ago • 0 comments

My app has a form type (StockType) with an autocomplete field that works fine.

class StockType extends AbstractType {

    public function buildForm(FormBuilder $builder, array $options) {
        $builder
            ->add('product', 'shtumi_ajax_autocomplete', array(
              'required' => true,
              'entity_alias' => 'products',
              'label' => 'Producto: ',
        ))
        ->add('amount', null);
    }

// ...
}

Then I added a form collection named StockCollectionType:

class StockCollectionType extends AbstractType {

    function buildForm(FormBuilder $builder, array $options) {
        $builder
            ->add('items', 'collection', array(
                'type' => 'stock_type',
                'allow_add' => true,
                'allow_delete' => true,
                'by_reference' => false,
                'options' => array('required' => true)
        ));
    }

// ...
}

for some reason it seems not to be working.

carlescliment avatar Nov 09 '12 10:11 carlescliment