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
_______________________________________________
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]