Hello

I have a form with 42 biz objects created with the data wizard and
put in the createBizobjs method of the form.

Which of the 42 files is the primary biz object?

When the data wizard creates a biz object it creates the following lines:

        
        class PubliccompanyBizobj(dabo.biz.dBizobj):
                def afterInit(self):
                        self.DataSource = "public.company"
                        self.KeyField = "companyid"
                        self.addFrom("public.company")
                        self.addField("companynameshort")
                        self.addField("companyname")
                        self.addField("labelercode")
                        self.addField("companyid")

                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

        publiccompanyBizobj = PubliccompanyBizobj(self.Connection)
        self.addBizobj(publiccompanyBizobj)
---------------------------------------------------------------------------
The last 2 lines instantiate the biz object.
Also the data wizard set the references in the text boxes it created.

I have a page with a list box that I filled with the following code:
---------------------------------------------------------------------------
## *!* ## Dabo Code ID: dTextBox-dPanel-892
def onKeyUp(self, evt):
        # print self.Value
        if self.Value <> None:
                bizCompany = self.Form.getBizobj("public.company")
                bizCompany.setWhereClause("companyname ilike '%%%s%%'" % 
self.Value)
                bizCompany.setOrderByClause("companyname")
                bizCompany.requery()
                dsCompany = bizCompany.getDataSet(flds=("companyid", 
"companyname"))
                # print dsCompany
                if dsCompany:
                        self.Form.lstbxCompany.Choices = [rec["companyname"] 
for rec in 
dsCompany]
                        self.Form.lstbxCompany.Keys  = [rec["companyid"] for 
rec in dsCompany]          
                else:
                        self.Form.lstbxCompany.Keys = [""]
                        self.Form.lstbxCompany.Choices = [""]
                #cursorGeneric = self.Form.PrimaryBizobj.getTempCursor()
                # cursorGeneric.execute('select Companyid, name from 
alchemy_generic_product order by name')
                # dsGeneric = cursorGeneric.getDataSet()
                # self.Form.lstbxGenericName.Choices = [rec['name'] for rec in 
dsGeneric]
                # self.Form.lstbxGenericName.Keys = [rec['Companyid'] for rec 
in 
dsGeneric]
                self.Form.lstbxCompany.refresh()

I double click a selection in the list box and have the following handler:
-----------------------------------------------------------------------

## *!* ## Dabo Code ID: dListBox-dPanel-474
def onMouseLeftDoubleClick(self, evt):
        self.Form.txtComapnyName.Value = self.Value
        self.ValueMode = "Key"
        self.Form.txtCompanyID.Value = self.Value
        self.ValueMode = "String"
        if self.Form.txtCompanyID.Value <> "":
                self.Form.publiccompanyBizobj.setWhereClause("companyname ilike 
'%%%s%%'" % self.Form.txtCompanyID.Value)
                self.Form.publiccompanyBizobj.setOrderByClause("companyname")
                self.Form.publiccompanyBizobj.requery()
                self.Form.refresh()

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I get the list box filled fine but haven't figured out how to get the 
list boxes to display the details of the list box selection.

How do I set the text Boxes that the data wizard created and keep the 
grid choices the same? Multiple items from the biz object showing in the 
grid but only the selection showing in the detail text boxes below the 
list box.

This from the bizObject shown above.

        publiccompanyBizobj = PubliccompanyBizobj(self.Connection)
        self.addBizobj(publiccompanyBizobj)

doesn't this set a reference to the biz object
as Form.publiccompanyBizobj?
Or do I have to something else here to create a Form reference to the 
company bizObject?

Thanks

Paul McNary
[EMAIL PROTECTED]







_______________________________________________
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