Probably not. ajax calls do not execute JS embedded in loaded content.
On Oct 17, 5:59 pm, "david.waldrop" <[email protected]> wrote: > Thanks for the suggestions. I tried both, but I still cannot get it to > work. I think I have it isolated to the fact that the textbox i am > trying to use autocomplete on is loaded in a view using the LOAD > command. In fact it is the technique I am using is identical to the > tagging widget. IS it possible to use the autocomplete widget in this > manner? > > On Oct 17, 4:13 pm, mdipierro <[email protected]> wrote: > > > SQLFORM.factory(Field('item_cat'),widget=SQLFORM.widget.autocomplete(reques > > t, > > db.cat.name)) > > > or > > > SQLFORM.factory(Field('item_cat',db.cat),widget=SQLFORM.widget.autocomplete > > (request, > > db.cat.name, id_field=db.cat.id) ) > > > On Oct 17, 2:50 pm, "david.waldrop" <[email protected]> wrote: > > > > some minor progress. The following now lets thge loaded component > > > work, but does not do the autocomplete . > > > > addform = > > > SQLFORM.factory(Field('item_cat'),widget=SQLFORM.widget.autocomplete(reques > > > t, > > > db.cat.name, id_field=db.cat.id) ) > > > > Is there something special I need to do to get the autocomplete to > > > work inside a loaded component? > > > > On Oct 17, 2:24 pm, "david.waldrop" <[email protected]> wrote: > > > > > I have now tried this > > > > > addform = > > > > SQLFORM.factory(Field('item_cat'),widget=autocomplete(request, > > > > db.cat.name, id_field=db.cat.id) ) > > > > > but it doesn't work either. > > > > > On Oct 17, 10:58 am, "david.waldrop" <[email protected]> wrote: > > > > > > I have a form created with SQLFORM.factory containing a single field > > > > > > addform = SQLFORM.factory(Field('item_cat')) > > > > > > Is there a way to use the autocomplete widget. I have searched and > > > > > seen examples where I set the widget in the model, but do cannot find > > > > > an example of how to associate the autocomplete widget with a field > > > > > when using SQLFORM.factory. > > > > > > I did get it to work in the model bu using something like the > > > > > following: db.itemcat.cat_ref.widget = > > > > > SQLFORM.widgets.autocomplete(request, db.cat.name, id_field=db.cat.id) > > > > > > I am sure someone has done this and very much would love to see an > > > > > example. > >

