I just wanted to add taht in that snippet "tags_list" is not a casual
name, is the name of the field generated by symfony that shows the
elements of the other side of the relation. In that way you will
overwrite it. I'm missing a comment like that in the snippet.

On Mar 1, 5:20 pm, Javier Garcia <tirengar...@gmail.com> wrote:
> I found this snippet maybe will be usefull:
>
> http://snippets.symfony-project.org/snippets/from/antitoxic/order_by/...
>
> On Feb 28, 10:40 am, Javier Garcia <tirengar...@gmail.com> wrote:
>
> > Alex, what do you mean with "It's maybe more along the lines of a
> > feature that
> > would be nice to have". Sorry because my english..
>
> > On 26 Feb, 20:27, Alex Pilon <alex.pi...@gmail.com> wrote:
>
> > > I don't think its a bug. It's maybe more along the lines of a feature that
> > > would be nice to have.
>
> > > Maybe try 
> > > thishttp://www.symfony-project.org/plugins/sfDoctrineFBAutocompletePlugin
>
> > > On Sat, Feb 26, 2011 at 11:23, Javier Garcia <tirengar...@gmail.com> 
> > > wrote:
> > > > Ok, now I understand how this widget works..When you create this kind
> > > > of widget, it actually creates two fields: autocomplete_my_field (the
> > > > field that is showed and where you insert the data (values of the
> > > > array elements) and my_field (a hidden field, where the keys are
> > > > inserted).
>
> > > > This widget works ok when you insert only an element but when you
> > > > insert more than an element the key of the elements are overwritten
> > > > (the id of the second element overwrites the id of the the first one,
> > > > the id of the third element overwrites the id of the second
> > > > one, ....), so you can not retrieve all them. So it's a bug I think..
>
> > > > Javier
>
> > > > On Feb 24, 4:27 pm, Javier Garcia <tirengar...@gmail.com> wrote:
> > > > > Hi,
>
> > > > > i have this widget :
>
> > > > >     $this->widgetSchema['user']  = new sfWidgetFormChoice(array(
> > > > >       'choices'          => array(),
> > > > >       'renderer_class'   => 'sfWidgetFormJQueryAutocompleter',
> > > > >       'renderer_options' => array('url' => 'autocomplete', 'config' =>
> > > > > '{ multiple:true }'),
> > > > >     ));
>
> > > > > And this is the autocomplete function:
>
> > > > >   public function executeAutocomplete($request)
> > > > >   {
>
> > > > >     $this->getResponse()->setContentType('application/json');
>
> > > > >     $q = "%" . $request->getParameter('q') . "%";
>
> > > > >     $limit = $request->getParameter('limit');
>
> > > > >     //Criteria code
>
> > > > >     return $this->renderText(json_encode($cli));
>
> > > > >   }
>
> > > > > that returns this ("Response" tab in Firebug):
>
> > > > > {"17":"John","18":"Ann"}   //the numbers are the values in the id
> > > > > field.
>
> > > > > Then i choose both names in the autocomplete input this way:
>
> > > > > [John, Peter]
>
> > > > > When i submit the form, the getPostParameters() method returns this:
>
> > > > > array
> > > > >   'example' =>
> > > > >     array
> > > > >       'id' => string '' (length=0)
> > > > >       '_csrf_token' => string
> > > > > '388774046d0f5c8b4a3f114ddb15af7b' (length=32)
> > > > >       'user' => string '18' (length=2)
> > > > >   'autocomplete_example' =>
> > > > >     array
> > > > >       'user' => string 'John, Ann, '
>
> > > > > So what should i do to retrieve the id's of the users?
>
> > > > > sf 1.4.
>
> > > > > Javier
>
> > > > --
> > > > 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 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
>
> > > --
> > > Alex Pilon
> > > (613) 608-1480

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