Changeset 244

Show
Ignore:
Timestamp:
07/06/06 22:08:44 (2 years ago)
Author:
matt
Message:

Ho hum, the Composite widget was not actually rendering values fed to it. It now
constructs a new args for the child widgets to use. Yes, it's a bit of a hack.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/composite-2/formal/examples/composite.py

    r243 r244  
    3636        form.addAction(self.submitted) 
    3737 
     38        form.data = { 
     39            'temperature': {'temperature': 28, 'units': 'oC'}, 
     40        } 
     41 
    3842        return form 
    3943 
  • branches/composite-2/formal/widgets/composite.py

    r243 r244  
    2727 
    2828    def render(self, ctx, key, args, errors): 
     29 
     30        if not errors: 
     31            value = args.get(key) or {} 
     32        else: 
     33            value = None 
     34 
    2935        for name, type in self.composite.composition: 
    3036            childKey = '.'.join([key, name]) 
     37            if value is not None: 
     38                args = {childKey: value.get(name)} 
    3139            yield T.div(class_=('composite-component', ' ', name))[ 
    3240                T.label(for_=formal.util.render_cssid(childKey))[