Steve Rose wrote:
> Thanks for your patience guys. I can now work with the cats and dogs tables
> with 2 independent bizobjs. But I think I'm missing some deeper
> understanding of bizobjects. If you can set me straight on the following
> example, I think I might get it through my thick head:
>
> Say I have a form with 2 grids and 1 bizobj, "bizcats", datasourced to a
> "cats" table. I want the first grid to display ALL the cat records in the
> table. The second grid will display only results from queries run against
> the same cats table ("select * from cats where color = 'black' "). How do I
> set things up so that a query on the cats table does not affect the results
> seen in the first grid, which should still display all records in the cats
> table? So, I guess what I'm trying to get at is how can I work with the
> same table and have multiple, independent views of it on the form's
> controls. Coming from a dBase background, I'd just use multiple query
> objects to do the job, but I can't change my thinking enough to do this task
> using bizobjs. Hope this make sense.
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.
Paul
_______________________________________________
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]