Chapter 16. TurboGears Widgets: Bringing CSS, XHTML, and JavaScript Together in Reusable Components


In This Chapter

  • 16.1 Understanding Widgets 310

  • 16.2 Form Widgets 314

  • 16.3 Compound Widgets 317

  • 16.4 Widgets and Validation 318

  • 16.5 CSS, JavaScript, and Widgets 324

  • 16.6 Creating Custom Widgets 325

  • 16.7 Anatomy of an Ajax Widget 328

  • 16.8 Summary 330

If you develop web applications, there are a lot of things that you find yourself doing over and over and over again. If you are any good at your job, you don't want to write the same code over and over again with only small differences. Instead, you want to move that stuff out into separate functions, or even separate reusable packages. That's what TurboGears widgets are all about.

Widgets are particularly useful when you want to define reusable elements with complex display logic. Probably the most common web task that widgets are used for is form generation and display. So, the widgets package is integrated in with Form Encode, which helps validate form data and translate form data into valid Python objects.




Rapid Web Applications with TurboGears(c) Using Python to Create Ajax-Powered Sites
Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites
ISBN: 0132433885
EAN: 2147483647
Year: 2006
Pages: 202

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net