main logo
Subject: Re: [dabo-users] [part 2] a Simple tutorial on bizObjects`
Author: Uwe Grauer <uwemailmeister AT googlemail D.OT com>
Posted: 2007.12.12 at 14:03:25
 
View Entire Thread
New Search


	johnf wrote:
> ...
> #the customer table
> class PublicarcustBizobj(dabo.biz.dBizobj):
>       def afterInit(self):
>               self.DataSource = "public.arcustomer"
>               self.addFrom("public.arcustomer")
>               self.KeyField = "pkid"
>               self.addField("czip")
>               self.addField("city")
>               self.addField("pkid")
>               self.addField("state")
>               self.addField("company")
>               self.addField("address1")
>               self.addField("address2")
>               self.addField("country")
>               self.addField("custno")
>
>
 
Wrong indentation for validateRecord?
 
> def validateRecord(self):
>       """Returning anything other than an empty string from
>       this method will prevent the data from being saved.
>       """
>       ret = ""
>       # Add your business rules here.
>       return ret
>
> class CustomerPanel(dabo.ui.dPanel):
>       def afterInit(self):
>               self.Sizer=vs=dabo.ui.dSizer('h')
>               gs = dabo.ui.dGridSizer(MaxCols=4,HGap=3, VGap=3)
>               gs.append(dabo.ui.dLabel(self, Caption="Cust #"), halign="right")
>               gs.append(dabo.ui.dTextBox(self, RegID="txtCustomerID",TextLength =
> 10,DataSource ="public.arcustomer", DataField = "custno"), "expand",
> colSpan=3)
>               gs.append(dabo.ui.dLabel(self, Caption="Address"), halign="right")
>               gs.append(dabo.ui.dTextBox(self, RegID="txtAddress1",TextLength =
> 35,DataSource ="public.arcustomer", DataField = "address1"), "expand",
> colSpan=3)
>               gs.append(dabo.ui.dLabel(self, Caption=""), halign="right")
>               gs.append(dabo.ui.dTextBox(self, RegID="txtAddress2",TextLength =
> 35,DataSource ="public.arcustomert", DataField = "address2"), "expand",
> colSpan=3)
>               gs.append(dabo.ui.dLabel(self, Caption="City"), halign="right")
>               gs.append(dabo.ui.dTextBox(self, RegID="txtCity",DataSource
> ="public.arcustomer", DataField = "city"), "expand", colSpan=3)
>               gs.append(dabo.ui.dLabel(self, Caption="Country"), halign="right")
>               gs.append(dabo.ui.dTextBox(self, RegID="txtCountry1",DataSource
> ="public.arcust", DataField = "country"), "expand", colSpan=3)
>               gs.append(dabo.ui.dLabel(self, Caption="State"), halign="right")
>               gs.append(dabo.ui.dTextBox(self,
> RegID="txtSateID",ForceCase='upper',TextLength=2,DataSource
> ="public.arcustomer", DataField = "state"))
>               gs.append(dabo.ui.dLabel(self, Caption="Zip"), halign="right")
>               gs.append(dabo.ui.dTextBox(self, RegID="txtZipD",TextLength=10,DataSource
> ="public.arcustomer", DataField = "czip"), "expand")
>               vs.append(gs,0,'x')
>
>
> class ContactsPanel(dabo.ui.dPanel):
>       def afterInit(self):
>               self.Sizer = dabo.ui.dSizer("v")
>               hs=dabo.ui.dSizer("h")
>               contactGrid = dabo.ui.dGrid(self,RegID="contgridID",AlternateRowColoring
> =True,ColumnCount=6,SelectionMode = "Row",Editable = True,MovableColumns =
> False)
>
 
Why is the following line commented out?
 
> #self.contactGrid.bindEvent(dabo.dEvents.GridCellSelected,self.onGridCellSelected)
>               contactGrid.DataSource = "public.contacts"
>               contactGrid.Columns[0].Caption ="Title"
>               contactGrid.Columns[0].DataField = "title"
>               contactGrid.Columns[1].Caption ="First"
>               contactGrid.Columns[1].DataField = "firstname"
>               contactGrid.Columns[2].Caption ="Last"
>               contactGrid.Columns[2].DataField = "lastname"
>               contactGrid.Columns[3].Caption ="Email"
>               contactGrid.Columns[3].DataField = "email"
>               contactGrid.Columns[4].Caption ="Phone"
>               contactGrid.Columns[4].DataField = "phone"
>               contactGrid.Columns[5].Caption ="Continent"
>               contactGrid.Columns[5].DataField = "continent"
>               hs.append(contactGrid,1,'x')
>               self.Sizer.append(hs,1,'x')
>
> ...
 
Uwe
©2007 Uwe Grauer
Powered by Rackspace Cloud Computing
Powered by Rackspace Cloud Computing