Jorge Godoy wrote: > Gary Doades <[EMAIL PROTECTED]> writes: > >> I think that the widgets are definitely the way to go. It's the "big >> picture" that seems to be problematic. I'm not sure that ToscaWidgets >> fixes any of this, but I've only had a quick play with them. > > Anyway, you have to remember that you don't need to be limited by the default > widget template or even the default parameters that a widget accepts. > Subclassing a widget and creating your own is really easy!
I agree and I've done that already for a couple of widgets (CheckboxList) to get different behaviour. However, I think I'll end up subclassing the whole widgets system before I'm finished. > ..... > Those are "100%" custom widgets. But you can also subclass a widget just to > change its template -- it might be worth if you're using this alternative > template in several places to avoid having to specify the new template every > time -- or even add new parameters. Wanna see an example? > Again, I understand this and I have already subclassed a couple of widgets to change the template etc. I've even created a CSSForm derived from Form to layout a form using CSS rather than Table or List Forms. What I'm really talking about though is not creating new widgets with different behaviour, but getting standard behaviour into even the simplest widgets to just manipulate their properties at runtime. I see two options for myself at the moment: Subclass all the widgets I want to use and change the underlying code to enable changeing lots of things at runtime. This seems a potentially large sub-project though that I don't really want to tackle right now. Change my controllers to create a list of widgets at runtime and set properties etc. that way. This will certainly work and it very clean, but is a runtime performance hit because of re-creating the widgets for every request. In my design, this web application will end up with around 80 different forms (hopefully quite a few re-usable generic templates :) ) but I guess I need to determine my strategy now. Thanks for all your input, Gary. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

