You have servicedate in one and serviceDate in another...it's case sensitive.
Larry Long > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of [email protected] > Sent: Monday, July 27, 2009 4:15 PM > To: [email protected] > Subject: [dabo-users] setFocus error > > OK I'm working on the "Step by step " application, and now > I've made progress on the "Add Hours" screen. But I'm getting > an error on the save button OnHit code: > > def onHit(self, evt): > if self.Form.save(): > # A failed save will return False. We only want to proceed > if # the save succeeds. > self.Form.new() > self.Form.servicedate.setFocus() > > > On clicking save, the entry is indeed saved, and a new record > is setup for the screen, but the setFocus causes an error > (see below for full listing) : > <<object has no attribute 'serviceDate'>> > > I understand that this code is supposed to put cursor back on > the date field so a new entry can be made. I don't understand > why referring to the dDateTextBox object as 'serviceDate' > would work, other than that this is the value of the > datafield property (and the name of the field in the hours table). > > I tried using << self.Form.dDateTextBox.setFocus() >> and got > the same error. > > Thanks for any help... > > Jonathan Poor > > ===Here's the traceback:===== > > C:\Documents and Settings\Jonathan > Poor\DABO\ClientHours>python main.py Traceback (most recent > call last): > File > "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\ui > wx\dControl > Mixin.py", line 27, in _onWxHit > self.raiseEvent(dEvents.Hit, evt, *args, **kwargs) File > "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\ui\ui > wx\dPemMixi > n.py", line 949, in raiseEvent > super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, > *args, **kwargs) File > "c:\python25\lib\site-packages\Dabo-0.9.2-py2.5.egg\dabo\lib\e > ventMixin.p > y", line 93, in raiseEvent > bindingFunction(event) > File "c:\docume~1\jonath~1\locals~1\temp\tmptidzcf.py", line > 314, in onHit > self.Form.serviceDate.setFocus() > AttributeError: 'dForm_31385' object has no attribute 'serviceDate' > **************A bad credit score is 600 & below. Checking > won't affect your score. See now! > (http://pr.atwola.com/promoclk/100126575x1221823322x1201398723 > /aol?redir=http://www.freecreditreport.com/pm/default.aspx?sc= > 668072&hmpgI > D=62&bcd=JulyBadfooterNO62) > > > --- StripMime Report -- processed MIME parts --- multipart/alternative > text/plain (text body -- kept) > text/html > --- > [excessive quoting removed by server] _______________________________________________ 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/!~!uenerkvcmdkaaqacaaaaaaaaaaaaaaaaabgaaaaaaaaaafa2fnyupuomnfpiynbeqckaaaaqaaaaxit9azuig0wklsmcqxuucqeaa...@charter.net
