dabo Commit
Revision 3176
Date: 2007-06-13 09:30:34 -0700 (Wed, 13 Jun 2007)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/3176
Changed:
U trunk/dabo/ui/uiwx/dGrid.py
Log:
Fixed a couple things in dGrid while reviewing the source after Carl's query:
1) grid.getBizobj() should return grid.DataSource if it is a direct bizobj
reference. Was returning None if there wasn't a bizobj registered with
the form with the same DataSource. Was returning the form's registered
bizobj if there was, even if the user explicitly set grid.DataSource to
a bizobj reference (which could be a different bizobj from the one
registered with the form, such as the bizSecondary case).
2) Same thing in grid._onGridCellSelected: if it is a direct bizobj
reference, go directly to the bizobj instead of trying to allow the
form to mediate.
Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2007-06-13 15:28:09 UTC (rev 3175)
+++ trunk/dabo/ui/uiwx/dGrid.py 2007-06-13 16:30:34 UTC (rev 3176)
@@ -117,9 +117,6 @@
# Already done, no need to take the time.
return
- app = self.grid.Application
- form = self.grid.Form
-
for idx, col in enumerate(colDefs):
nm = col.DataField
while not nm:
@@ -2730,6 +2727,8 @@
def getBizobj(self):
ds = self.DataSource
+ if isinstance(ds, dabo.biz.dBizobj):
+ return ds
if isinstance(ds, basestring) and self.Form is not None:
form = self.Form
while form is not None:
@@ -3060,7 +3059,7 @@
bizobj = self.getBizobj()
if bizobj:
if bizobj.RowCount > newRow and
bizobj.RowNumber != newRow:
- if isinstance(self.Form, dabo.ui.dForm):
+ if isinstance(self.Form, dabo.ui.dForm)
and not isinstance(self.DataSource, dabo.biz.dBizobj):
# run it through the form:
if not
self.Form.moveToRowNumber(newRow, bizobj.DataSource):
dabo.ui.callAfter(self.refresh)
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]