----- "Aaron Carlow" <[email protected]> wrote:
> >
> > I think I get it now. For some reason I never made the connection
> that
> bizObj.DataSource == TableName. I assumed that the table name was not
> tied
> directly to the DataSource name. If I'm correct this means that you
> cannot
> create more than one instance of a bizobj that uses the same table
> because
> then the DataSource string/identifier is the same and the program has
> no way
> of differentiating between the two, correct? What is the recommended
> way of
> having two unconnected dPages that the use the same table as the
> source?
>
> class EventBizobj(dabo.biz.dBizobj):
> def afterInit(self):
> self.DataSource = "Event"
> self.KeyField = "EventID"
> self.addFrom("Event")
> self.addField("Event.EventName")
> ...
>
> def createBizobjs(self):
> conn = self.Application.getConnectionByName('ServerName-MySQL')
>
> bizEvent = self.Application.biz.EventBizobj(conn)
> self.addBizobj(bizEvent)
>
> bizEventView = self.Application.biz.EventBizobj(conn)
> self.addBizobj(bizEventView)
>
> With this code both bizobjs have the same DataSource since they are
> using
> the same table and therefore the Dabo framework can't differentiate
> the two.
> Could I do:
>
> bizEventView.DataSource="SomeArbitraryname"
>
> and have it accessible as a DataSource in a dGrid for instance using
> "SomeArbitraryName" but in fact pulling data from the "Event" table?
>
> Really appreciate how helpful you guys are, especially to someone who
> is
> such an obvious newbie.
>
> Aaron L. Carlow
>
>
I may be missing something but why do you need to create two instances of the
same bizobj? The self.addBizobj binds it to the Form. It then makes it
available to all the data controls in the Form. Why not just reference it by
the same name in the different parts of the Form?
Adrian Klaver
[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/2036606362.2051471256844384087.javamail.r...@sz0030a.emeryville.ca.mail.comcast.net