#1160: ClassDesigner throws AttributeError on opening design with DataSource
----------------------------+-----------------------------------------------
Reporter: nate | Owner:
Type: defect | Status: new
Priority: blocker | Milestone: 0.9
Component: ide | Version: 0.8.3
Keywords: Class Designer |
----------------------------+-----------------------------------------------
I attached a cdxml file for you to look at. In the file we have a
checkbox that has a DataSource set to "nonexistantObject". When I set the
dataSource in the file initially it does not throw an error. Good.
However, when I close the file and open it again I get this traceback:
Traceback (most recent call last):
File "c:\Python25\lib\site-packages\dabo-
full\trunk\dabo\ui\uiwx\dMenuItem.py"
, line 55, in __onWxHit
self.raiseEvent(dEvents.Hit, evt)
File "c:\Python25\lib\site-packages\dabo-
full\trunk\dabo\ui\uiwx\dPemMixin.py"
, line 922, in raiseEvent
super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,
**kwargs)
File "C:\Python25\lib\site-packages\dabo-
full\trunk\dabo\lib\eventMixin.py", l
ine 92, in raiseEvent
bindingFunction(event)
File "ClassDesigner.py", line 1712, in onOpenDesign
self.openClass(ff)
File "ClassDesigner.py", line 695, in openClass
obj = self.recreateChildren(frm.mainPanel, kids, None, False)
File "ClassDesigner.py", line 847, in recreateChildren
self.recreateChildren(parent, [kid], sz, True)
File "ClassDesigner.py", line 945, in recreateChildren
skipUpdate=True, attProperties=atts)
File "ClassDesigner.py", line 2592, in addNewControl
obj = mixedClass(parent, properties=props,
attProperties=attProperties)
File "ClassDesigner.py", line 2731, in __init__
apply(base.__init__,(self,) + args, kwargs)
File "C:\Python25\lib\site-packages\dabo-
full\trunk\dabo\ui\uiwx\dCheckBox.py"
, line 19, in __init__
attProperties, *args, **kwargs)
File "C:\Python25\lib\site-packages\dabo-
full\trunk\dabo\ui\dDataControlMixinB
ase.py", line 22, in __init__
dabo.ui.dControlMixin.__init__(self, *args, **kwargs)
File "c:\Python25\lib\site-packages\dabo-
full\trunk\dabo\ui\uiwx\dPemMixin.py"
, line 118, in __init__
attVal = eval(val)
File "<string>", line 1, in <module>
AttributeError: 'controlMix' object has no attribute 'nonexistantObject'
Here is the trouble with the real world. I have a dialog that gets passed
bizobjs through it's __init__ method, which I have overrided in code. The
bizobj is stored as self.myBizobj. I set the DataSource property on
controls to self.Parent.myBizobj. When I run the form, everything is fine
and the DataSource is evaluated. However, if I open the form in the CD I
get this AttributeError. So, for the time being I am forced to manually
set DataSource and DataField values in the afterInitAll method.
When loading a CD file, objects declared in coded methods are not
recognized because we aren't creating the class. Therefore, any reference
should fail. The error should be thrown at Run Time, not in the CD...
--
Ticket URL: <http://trac.dabodev.com/ticket/1160>
Dabo Trac <http://trac.dabodev.com>
Trac Page for Dabo
_______________________________________________
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/[EMAIL PROTECTED]