[Zope3-Users] zc.table FieldColumn question
    ksmith93940-dev at yahoo.com 
    ksmith93940-dev at yahoo.com
       
    Fri Nov 17 14:13:55 EST 2006
    
    
  
Does anyone have a simple example of how FieldColumn
is used?
I'm quite sure I'm missing a very serious step here,
but have been unable to figure out how to "trigger"
the update method. Any help at all would be
appreciated.
I've tried the following, the request values show on
screen but fail to update the object. 
class MovieColumnSubmit(fieldcolumn.SubmitColumn):
    def getId(self, item, formatter):
        return fieldcolumn.toSafe(item.__name__)
   
        
class MovieColumn(fieldcolumn.FieldColumn):
    def getId(self, item, formatter):
        return fieldcolumn.toSafe(item.__name__)
        
class TableView(BrowserPage):
    
    columns = (
       MovieColumn( IMovieTime['brief']),
      MovieColumn( IMovieTime['times']),
      MovieColumnSubmit("apply", "MYFORM"),
               )
  
    def __call__(self):
        items = [value for name, value in
self.context.items()]
        formatter = table.Formatter(
                self.context, self.request, items,
('brief', 'times', 'MYFORM'),
                columns=self.columns,
prefix="tableview")
        
        return """<html><head></head><body><form
action="./@@TableView.html">%s</form></body></html>"""
% formatter()  
    
    
More information about the Zope3-users
mailing list