<body>
    ${tmpl_context.testwidget.display()}
gives me UndefinedError: '' has no member named "display"


class TestWidget(Widget):
    javascript = [ JSLink(link=url('/js/chart.js')) ]
    template = "pkg.templates.widgettest"
    engine_name = "genshi"

    def __init__(self, name):
        super(TestWidget, self).__init__(self)

    def update_params(self, d):
        super(TestWidget, self).upadate_params(d)
        #I read that this must be done explicitly
        self.add_call(javascript)
        #Invoke javascript from myscript.js here?
        #But won't this re-inject the JS for
        #every rendering? I thought I read TG's
        #smart enough to do it just once if I ...?

testwidget = TestWidget("TestTW")


@expose('pkg.templates.widgettest')
def widgettest(self, **kw):
    pylons.c.widgettest = testwidget
    return dict(form=testwidget)  #, action=blah, value=blah)


<body>
    <p py:content="form.display(submit_text='Yes')">
       Widget Form</p>
gave me UndefinedError: "tg" not defined


The above code works in the sense that there
are no errors thrown.   Clicking on the link
for my controller method 'widgettest' renders
the page with title and the text in the div
that is supposed to be replaced.  But no JS
action occurs onscreen.  :{


PS.
 There is nothing in the rendered page's
source <head> section resulting.

Putting the code below into the template works
in so far as it appears if I View Page Source.
However, nothing happens, the JS does not
appear to run.
  <script type="text/javascript" src="${tg.url('/js/chart.js')}"></
script>
</head>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to