On Thursday 07 August 2008 03:20:17 pm Paul McNett wrote:
> Nate Lowrie wrote:
> > On Thu, Aug 7, 2008 at 4:04 PM, Paul McNett <[EMAIL PROTECTED]> wrote:
> >> Paul McNary wrote:
> >>> Paul McNett wrote:
> >>>> Just instantiate more than one instance of the bizobj, and work with
> >>>> them independently. You'll have to give them unique DataSource
> >>>> properties, however, so that dForm doesn't get confused. Example:
> >>>>
> >>>> {{{
> >>>> from bizcats import BizCats
> >>>>
> >>>> class MyForm(dabo.ui.dForm):
> >>>> def afterInit(self):
> >>>> app = self.Application
> >>>> self.bizCatsAll = BizCats(app.dbConnection,
> >>>> DataSource="cats_all") self.bizCatsSome = BizCats(app.dbConnection,
> >>>> DataSource="cats_some") self.addBizobj(self.bizCatsAll)
> >>>> self.addBizobj(self.bizCatsSome)
> >>>> }}}
> >>>>
> >>>> Now, set the DataSources of your 2 grids appropriately.
> >
> > I like to do:
> >
> > {{{
> > from bizcats import BizCats
> >
> > class MyForm(dabo.ui.dForm):
> > def afterInit(self):
> > app = self.Application
> > self.bizCatsAll = BizCats(app.dbConnection)
> > self.bizCatsSome = BizCats(app.dbConnection)
> > self.addBizobj(self.bizCatsAll)
> > }}}
> >
> > Set the DataSource inside the BizCats object to "cats" and just don't
> > add it to the form. You can then set your first grid DataSource to
> > "cats" to set it to the all bizobj and the 2nd grid you can set by
> > doing "self.myGrid2.DataSource = self.bizCatsSome". I am not sure
> > what Paul is getting at with the not filling in the addField...
>
> This works, too.
>
> The only reason I mentioned not filling in addField() was in explaining
> a case where DataSource tells Dabo the name of the backend table.
>
> Paul
Hey Paul I guess we are "bickering" LOL :-)
a third way.
Create a temp cursor from the Cats bizobj and use a SQL select statement for
the temp cursor
a four way
Create two different bizObjects using the same table and then you have
self.addBizobj(bizObj1)
self.addBizobj(bizObj2)
a fifth way
use the internal SQL
self.schgridDS = cats.getDataSet()
self.ds = self.schgridDS.execute("select * from dataset where color='Black')
Anybody think of a sixth?
--
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]