On Sun, Nov 27, 2005 at 08:28:27PM -0600, Steve Bergman wrote:
> 
> Gary Godfrey wrote:
> 
> >I ended up patching the source here.  To me it makes no sense that the
> >widget would create HTML.
> >
> >--- turbogears/widgets/__init__.py      (revision 250)
> >+++ turbogears/widgets/__init__.py      (working copy)
> >@@ -79,7 +79,7 @@
> >        return d
> >
> >    def render(self, value=None, input_values={}, error=None,
> >-               format="html", convert=True, **kw):
> >+               format="xml", convert=True, **kw):
> >        if not self.template:
> >            return None
> >
> >I don't think it will fix your javascript issue, but I think it makes
> >it cleaner.
> >
> > 
> I just found Kevin's "widgets first look" thread and apparently I was really 
> supposed to be using <py:replace="dateField.insert()"> anyway unless I 
> need to manually do something really off the wall with the generated html.  I 
> replaced master.kid with my own customized one from 0.8 and I think 
> that is where the calendar .css and ..js get referenced in 0.9.  I'm pretty 
> sure that's the reason its not finding that stuff.
> 
> -Steve

If you look at a newly quickstarted project, you'll see lines that refer to
tg_css, tg_js_head, etc.  You need all of those lines to have the css and
javascript added.

Also, you have to display your calendar widget within a form.  I think this
part is a little broken w.r.t. widgets and forms right now, but, if you put
your widget in the TableForm or something, turbogears.controller will pick
it up and pull out the javascript and css and send it to the template.

Jason

-- 
If you understand, things are just as they are.  If you do not understand,
things are just as they are.

Attachment: pgpNg1c2MoQcv.pgp
Description: PGP signature

Reply via email to