dabo Commit
Revision 2778
Date: 2007-02-04 12:42:07 -0800 (Sun, 04 Feb 2007)
Author: Paul

Changed:
U   trunk/dabo/ui/dDataControlMixinBase.py

Log:
Made the resolving of a source bizobj traverse the boundary of the Form if
self.Form is actually a dialog or some other frame without a getBizobj()
method. Given this structure:

dForm with bizobj on "customers"
 |
 -dDialog
     |
     -dTextBox with DataSource of "customers"

Previously, setting the DataSource to "customers" in the textbox would
result in not being connected to the bizobj, because from the perspective
of the textbox, self.Form is the dialog that doesn't have a getBizobj()
method. 

Now, it keeps going up the hierarchy looking for a dForm with the 
expected bizobj.



Diff:
Modified: trunk/dabo/ui/dDataControlMixinBase.py
===================================================================
--- trunk/dabo/ui/dDataControlMixinBase.py      2007-02-04 03:42:51 UTC (rev 
2777)
+++ trunk/dabo/ui/dDataControlMixinBase.py      2007-02-04 20:42:07 UTC (rev 
2778)
@@ -383,10 +383,15 @@
                                                except:
                                                        self.__src = None
                                                if self.__src is None:
-                                                       try:
-                                                               # It's a bizobj 
reference; get it from the Form.
-                                                               self.__src = 
self.Form.getBizobj(ds)
-                                                       except: pass
+                                                       # It's a bizobj 
reference; get it from the Form. Note that we could
+                                                       # be a control in a 
dialog, which is in a form.
+                                                       form = self.Form
+                                                       while form is not None:
+                                                               try:
+                                                                       
self.__src = form.getBizobj(ds)
+                                                                       break
+                                                               except 
AttributeError:
+                                                                       form = 
form.Form
                                                        if self.__src:
                                                                
self._srcIsBizobj = True
                return self.__src




_______________________________________________
Post Messages to: Dabo-dev@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to