On Dec 15, 2008, at 12:22 AM, Roger Lovelock wrote:
> Got the concepts - having trouble implementing! Specifically I am
> having
> trouble finding the right way to refer to the bizObj from within the
> code in
> my ui :-
Bizobjs are referenced within forms by their DataSource property. So
if the DataSource of the bizobj you're interested in is 'customer',
then you would use something like:
custBiz = frm.getBizobj("customer")
A special case is for the main bizobj associated with a form, called
the PrimaryBizobj. Unless you explicitly set it, the first bizobj
added to the form becomes the PrimaryBizobj.
> def requery(self):
> # pass any selection criteria here
> self.DataSet = self.Application.biz.membershiptypesBizobj.getDataSet()
It looks like you never created the bizobj and added it to your form.
Typically that is done in the form's createBizobjs() method, which
fires as part of the init process. You get the reference to the
*class* of bizobj to create by using the 'self.Application.biz.'
reference. So typically, you would have:
def createBizobjs(self):
app = self.Application
conn = app.getConnectionByName("customer")
custBiz =app.biz.CustomerBizobj(conn)
self.addBizobj(custBiz)
Since a bizobj needs a connection, you get that from the app, and then
instantiate a bizobj using that connection, and register it with the
form by passing it to addBizobj().
After that you can reference that bizobj in the form by calling
'self.getBizobj("customer")'. Or, in this case, since it was the only
one I added to the form, you could use 'self.PrimaryBizobj'.
Hope that helps,
-- Ed Leafe
_______________________________________________
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]