Can someone help with the TG autocomplete widget? I've got it
working, and now I'm trying to add a hidden field. Here's the code
I'm using, and the autocomplete works, but I don't know how to pass
the list for the hidden field correctly. And I don't know how to
poll the value of the hidden field once the user has made a
selection. TIA.
What would be really great is if someone could post a working example,
since all the Googling in the world only results in partial examples.
Once I get this one working, I'll post the example for everyone's
benefit.
- Van
def search(self, input):
query= model.ParentAgency.query()
input = input.lower()
matches = [(agen.name,agen.Id) for agen in query \
if str(agen.name).lower().startswith(input)]
agencyNames=[]
agencyIds=[]
for recs in matches:
agencyNames.append(recs[0])
agencyIds.append(recs[0])
print "VC: " + str(agencyNames)
return dict(agencyNames=agencyNames, agencyIds=agencyIds)
--------
def home(self):
self.acfield = AutoCompleteField(search_controller = "search",
search_param = "input",
result_name = "agencyNames")
return dict(acfield = self.acfield)
---------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---