On Saturday 21 February 2009 09:16:26 am johnf wrote:
>
> I'm using PostgreSQL database version 8.3.5 and psycopg 2.0.8.
>
> Here is the Code for the bizobj. I omit some of the fields because they are
> not related to the problem:
>
> class MaBiz(dabo.biz.dBizobj):
>         def afterInit(self):
>                 self.DataSource = "public.ma"
>                 self.KeyField = "pkid"
>                 self.addField("ma.pkid")
>                 self.addField("ma.name")
>                 self.addField("ma.vorname")
>                 self.addField("ma.eintritt")
>                 self.addField("ma.gebdat")
>                 self.addFrom("ma")
>                 self.addOrderBy("ma.name")
>
>                 self.DefaultValues = None
>
> The table:
> ----------
>
> CREATE TABLE ma (
>     pkid serial primary key,
>     name text,
>     vorname text,
>     gebdat date,
>     eintritt date
> );
>
> Code from main.py:
> ------------------
>
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> import dabo
> import sys
> sys.path.append("ui")
> import MainForm
> dabo.ui.loadUI("wx")
> dabo.autoBindEvents = False
>
> app = dabo.dApp()
> app.MainFormClass = MainForm.MainForm
> app.NoneDisplay = ""
> app.start()
>
> Relevant code from the panel of the dForm:
> ---------------------------------
>
> class MainPanel(dabo.ui.dPanel):
>         def afterInit(self):
>                 maBiz = self.Form.getBizobj("public.ma")
>                 self.Sizer = vs = dabo.ui.dSizer('v')
>                 gs = dabo.ui.dGridSizer(MaxRows=6, HGap=4, VGap=3)
>                 gs.append(MaLabel(self, Caption="Name:"))
>                 gs.append(MaTextBox(self, DataSource="public.ma",
> DataField="name"))
>                 gs.append(MaLabel(self, Caption="Vorname:"))
>                 gs.append(MaTextBox(self, DataSource="public.ma",
> DataField="vorname"))
>
>                 gs.append(MaLabel(self, Caption="Eintritt:"))
>                 gs.append(DateBox(self, DataSource="public.ma",
> DataField="eintritt"))
>                 gs.append(MaLabel(self, Caption="Geburtsdatum:"))
>                 gs.append(DateBox(self, DataSource="public.ma",
> DataField="gebdat"))
>
>                 vs.append(gs, layout="expand")
>
> Code for the class DateBox:
> ---------------------------
>
> class DateBox(dabo.ui.dMaskedTextBox):
>         
>         def initProperties(self):
>                 self.Format = "date-eu"
>                 self.ValueMode = "Masked"
>
>
> My system locale is de_DE.utf8.
>
> If I start the application, two error messages appear in the command line,
> one for each field 'eintritt' and 'gebdat' (see my previous post). If I try
> to close the application just after that (without changing any data), I'm
> beeing asked whether I want to save the changes. If I answer 'yes', I see a
> popup with "Speichern fehlgeschlagen" (Failed to save), and I see the
> following error message in the console:
>
> Dabo Error Log: Sat Feb 21 18:02:02 2009: Error in scanChangedRows:
>
> Sorry for the lengthy post, but I didn't want to omit possible relevant
> code.
>
> Best regards
>
> Peter

You have subclassed the dabo UI.  I'd first test the code using standard Dabo 
classes (yes I understand that it should work anyway).  I'd start with 
dDateTextBox and then move on to dMaskTextBox.  

"Failed to save" suggest that there is something wrong with the either the 
bizobj description or the data.  The fact that it is asking to save may have 
something to do with dMaskTextBox (because the data is changed from the mask- 
also there has something to do with the default dates being changed).  But 
before we get to that please test dDateBox.  If dDateBox works then test 
dMaskTexBox with no ValueMode.  Let us know the results.


-- 
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/[email protected]

Reply via email to