Ticket #1160 (closed defect: fixed)

Opened 1 month ago

Last modified 1 month ago

ClassDesigner throws AttributeError on opening design with DataSource

Reported by: nate Assigned to: ed
Priority: blocker Milestone: 0.9
Component: ide Version: 0.8.3
Keywords: Class Designer Cc:

Description

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

Attachments

testForm.cdxml (457 bytes) - added by nate on 07/15/08 10:25:12.

Change History

07/15/08 10:25:12 changed by nate

  • attachment testForm.cdxml added.

07/20/08 16:43:49 changed by ed

  • owner set to ed.
  • status changed from new to assigned.

OK, this is working here. Please try with the latest svn code and if it's working for you, you can close this ticket.

07/21/08 08:35:23 changed by nate

  • status changed from assigned to closed.
  • resolution set to fixed.

Ed,

Fixed a bug that was introduced with your 4300 commit. This is fully fixed in 4301 so I am closing the ticket.