Changeset 4258

Show
Ignore:
Timestamp:
07/09/2008 11:39:15 AM (1 month ago)
Author:
paul
Message:

It is possible for the user to hit the 'delete' button on a datanav
toolbar before the grid on the browsepage has even been created.
This fix catches that case and recovers gracefully.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/lib/datanav2/Form.py

    r4207 r4258  
    203203        super(Form, self).onDelete(evt) 
    204204        # Make sure that the grid is properly updated. 
    205         self.PageFrame.Pages[1].BrowseGrid.refresh() 
     205        try: 
     206            self.PageFrame.Pages[1].BrowseGrid.refresh() 
     207        except AttributeError, e: 
     208            # Grid may not even exist yet. 
     209            if "BrowseGrid" in str(e): 
     210                pass 
     211            else: 
     212                raise 
    206213 
    207214