On Monday 23 April 2007 12:11, Carl Karsten wrote: > Given the fun I have had trying to get controls in a .cdxml bound to > something other than self.something, I figured a simple example would be > good. and of course I can't get that to work either. Below is what I > thought would work, plus setting the RegID cuz that was the last thing Ed > told me to set, but I have no idea what to set it to. > > Also, from what I gather, the DataSource/Field descriptions are a bit > 'restricted' or maybe I don't understand what a dataset is. > > DataField: Specifies the data field of the dataset to use as the source of > data. > > DataSource: Specifies the dataset to use as the source of data. > > This description doesn't help me much: > RegID: Placeholder for the actual RegID property > > Here is my code and cdxml (which is nice and small now. Ed, did you > realize that something you did is only saving out the 'modified' values? I > didn't see it mentioned in the logs.) > > # bd1.py > # Bound to BO example #1 > > class myClass(object): > > def _getMyProp1(self): > return self._myProp1 > > def _setMyProp1(self, val): > self._myProp1=val > > MyProp1 = property(_getMyProp1, _setMyProp1, None, "My Prop #1") > > def _getMyProp2(self): > return self._myProp2 > > def _setMyProp2(self, val): > self._myProp2=val > > MyProp2 = property(_getMyProp2, _setMyProp2, None, "My Prop #2") > > def __init__(self): > self.MyProp1 = 'a' > self.MyProp2 = 'b' > > def swap(self): > self.MyProp1, self.MyProp2 = self.MyProp2, self.MyProp1 > > def test(self): > print self.MyProp1, self.MyProp2 > self.swap() > print self.MyProp1, self.MyProp2 > > > myObj=myClass() > myObj.test() > > import dabo > app = dabo.dApp() > app.MainFormClass = 'bd1.cdxml' > app.start() I'm not sure what you are doing but a dataset is normally a dict. It appears you are attempting to return a single char 'a' or 'b'. I think you are trying to set the value of a textbox. What is wrong with self.regID.Value = myObj.MyProp1? -- John Fabiani
_______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]
