Table Of Contents

Previous topic

Widgets Overview

Next topic

Widgets Overview

Guide to the TurboGears Widgets Documentation

If you’re learning Widgets, this page is intended to provide a clear pathway through the existing docs from learning the basics to total widget mastery.

There still a few docs yet to be written, but the docs listed below should provide you with enough information to easily see how the other widgets work.

Getting Started with Widgets

If you read through the following documents you should have a good understanding of how basic Widgets work.

  • Widgets Overview – Learn how Widgets work and what they can do to help you reuse bundles of HTML, CSS and JavaScript code in your templates.
  • Simple Widget Form Tutorial – Getting started with widget based forms that support automatic display of validation errors, and otherwise make form handling easy.
  • Dive Into Widgets – You don’t need to run a whole TurboGears application to play with widgets. You can explore TurboGears widgets from the Python prompt.
  • Calendar Date Picker – Nice, easy to implement calendar pop-ups for your application. Serves as a good example on how to use a mildly complex, pre-made widget in your application.
  • Widget Browser – Learn how to make the most of the Widget Browser application in the TurboGears Toolbox or browse through the list of available standard widgets in the widget list <List>.
  • Widget List – A list of Widgets that ship with the TurboGears distribution.

Going Further with Widgets

Learn how to create your own widgets. It’s not hard, and it can really help to keep your presentation layer clean and easy to understand and extend. Beyond that, these documents will help you write complex validation systems that work with widget based forms, and use widgets that are designed to work with your controller code to Ajaxify your pages.

Achieving Widget Mastery

  • Widget Packages – Create your own widget package which can be shared between applications, and even be uploaded to the cheeseshop.
  • Widgets with JavaScript and CSS – Understand the details of how Widgets work with “external” CSS and JavaScript files.
  • Building Dynamic Options Lists From Data Objects – If you have lots of callables defined for various select fields, you may want to consolidate those, with a couple of reusable factory functions. This recipe will help you know how.
  • Dynamic Form Validation – How to validate widget forms with validation schemas that dynamically adapt to the input data.
  • Dynamic Form Updates with AJAX – When you want to update parts of a form based on the user input without having to reload the whole page, you need to employ AJAX to dynamically load data from your controller. This page shows you how.
  • Compound Widgets – Learn how to build widgets that contain other widgets.

External Widget Tutorials and Documents

  • Rapid Web Applications with TurboGears chapter 16 covers widgets in depth.
  • Widgets in more details - Widgets and Validators.