There are a couple of ways that I know of for you to approach this. By
default all the tabber widget does is make sure the appropriate CSS and
Javascript files are loaded with the page. So what you could do is:

Initialize the tabber widget (should be done outside of the controller
classes in controllers.py, I usually put it right after all the import
statements)

from turbogears import widgets
tabber_widget = widgets.Tabber()

Then you can put 'tabber_widget' into the dict returned by your
controllers and leave the tabber code in the kid file. It *should* make
sure everything works from there.

The second option is to make your own widget that is a subclass of
Tabber and assign the template to it. If you have some tabber code that
you will be reusing a lot this is probably a good idea. Here is how you
would do it.

Again, in controllers.py after imports and before the controller
classes.

from turbogears import widgets

class MaramTabber(widgets.Tabber):
    template='''
                   <div class="tabber">
                        <div class="tabbertab"><h2>Principal</h2></div>
                        <div class="tabbertab"><h2>Principal</h2></div>
                   </div>
                   """

Then you should pass this widget into the controller and call it from
your .kid file. Here are what those sections might look like:

(In the controller)
    @expose(template="maram.templates.tabbertest")
    def tabbertest(self):
        return dict(tabber = MaramTabber())

(In the template)
...
    ${MaramTabber.display()}
...

Hope that helps. As far as I know the widget documentation is still "in
progress", but you can usually find someone who knows how to make it
work on the mailing list. Hopefully what I have given you here isn't
too far off the mark or forgetting something really obvious.

-Adam


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

Reply via email to