#777: Impossible to programatically set an AutoCompleteField default value
----------------------+-----------------------------------------------------
 Reporter:  godoy     |        Owner:  anonymous 
     Type:  defect    |       Status:  closed    
 Priority:  high      |    Milestone:  0.9a5     
Component:  Widgets   |      Version:  0.9a4     
 Severity:  critical  |   Resolution:  worksforme
 Keywords:            |  
----------------------+-----------------------------------------------------
Changes (by anonymous):

  * status:  new => closed
  * resolution:  => worksforme

Comment:

 It's not a bug in AutoCompleteField but in you app. Try:
 {{{
 #!py
     @turbogears.expose(html = 'ticket777.templates.clients')
     def index(self):
         values = dict(
             endereco = dict(endereco_text = 'Default Value'),
         )
 }}}

 In the Clients controller. You had 'addresses' instead of 'endereco' and
 'text' instead of 'endereco_text'. A snippet form the form so you can
 compare:

 {{{
 #!py
 class widgets_clients_addresses(widgets.WidgetsList):
     endereco = widgets.AutoCompleteField(
         search_controller="/clients/search_address",
         search_param="address",
         result_name="addresses",
         text_field = widgets.TextField(name = 'endereco_text',
                                        attrs = {'size':51},
                                        label = _(u'Endereço'),
                                        validator =
 validators.UnicodeString(if_empty = None)),
         )

 my_form_address = widgets.TableForm(fields = widgets_clients_addresses())
 }}}

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/777>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" group.
To post to this group, send email to turbogears-tickets@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to