"Michele Cella" <[EMAIL PROTECTED]> writes:

> Notice for people doing compound widgets with TG svn, you need to
> change something (most probably removing no more needed code), as an
> example I post the AutocompleteField diff:
>
> +    widgets = ["text_field", "hidden_field"]
>      template_vars = ["search_controller", "search_param",
> "result_name", "attrs"]
> +    text_field = TextField(name="text")
> +    hidden_field = HiddenField(name="hidden")
>      attrs = {}
>      search_controller = ""
>      search_param = "searchString"
>      result_name = "textItems"
>
> -    def __init__(self, name=None, text_field=None, hidden_field=None,
> **kw):
> -        super(AutoCompleteField, self).__init__(name, **kw)
> -        self.widgets["text_field"] = text_field or
> TextField(name="text")
> -        self.widgets["hidden_field"] = hidden_field or
> HiddenField(name="hidden")
> -
> -    def update_data(self, d):
> -        super(AutoCompleteField, self).update_data(d)
> -        d["text_field"] = self.widgets["text_field"]
> -        d["hidden_field"] = self.widgets["hidden_field"]
> -
>
> Isn't that nice? ;-)

Indeed it is. :-)  The simpler the better! :-)

-- 
Jorge Godoy      <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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-trunk
-~----------~----~----~----~------~----~------~--~---

Reply via email to