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...