On Nov 9, 2006, at 12:50 PM, Jorge Godoy wrote:
>
> "Adam Jones" <[EMAIL PROTECTED]> writes:
>
>> The easy one is to make an empty widget that returns nothing when its
>> display method is called, return that instead of None, and clean up
>> your template to just a ${carriers.display()} call.
>>
>> The harder one would be to alter SingleSelectField so that it does
>> not
>> emit html if there are no items in the list.
>
> The third alternative is a mix of the easy and JavaScript to make that
> particular widget invisible. :-)
I'd just like to mention that regardless of the approach you use to
disable the rendering of a form's field, you should take into account
that the Schema validator generated for that form will still expect
that field to be submited. So if, for example, you disable a required
field, validation will always fail unless you provide a fallback
value or do some trickery to inform the Schema that that field is
disabled (pretty ugly black-magic BTW :( ).
Alberto
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---