> ... users can define their own...
True, but this case requires the modification of the standard SELECT.
> Do people really use OPTGROUP frequently?
Good question.
The code for OPTGROUP is almost a copy of SELECT but it does not work
with the current SELECT:
class OPTGROUP(DIV):
"""
NOTE: this does not work with the current SELECT helper
"""
tag='optgroup'
def postprocessing(self):
components=[]
for c in self.components:
if isinstance(c,OPTION):
components.append(c)
else:
components.append(OPTION(c,_value=str(c)))
if self.attributes.has_key('value') and \
self.attributes['value']!=None and \
self.attributes['value']==components[-1].attributes['_value']:
components[-1].attributes['_selected']=ON
self.components=components