On Dec 12, 2008, at 11:21 AM, Bob Sysero llc Dev wrote:
> I been working on taking the the HowTo Create a OpenOffice
> SpreadSheet
> using the Class Designer using three different methods which are:
>
> I - Entering all the code within the Class Designer.
> II - Entering the spreadsheet code into the customerBizobj that is
> in the biz dir and calling the onHit from within the Class
> Designer.
> III - Last is placing the spreadsheet code in a module in the current
> project dir and again calling the onHit code within the Class
> Designer.
>
> What I am trying to do is learn how to using the Bizobjs within the
> CD
> to allow special interfacing. I have been working with Johnf in
> learning on how to uses Dabo and later If Ed wants me to include this
> into HowTo to Create a OpenOffice SpreadSheet using the Class
> Designer.
>
> The problem I am having is in Method II and Method III in the onHit
> event for my button "Create Spread Sheet" using the Class Designer.
> I am
> trying to pass the DataSet from my customerBizobj into my
> spreadSheetInXXXXX().
Here's a general design pattern that may seem like more work, but
actually keeps your code cleaner and easier to manage. First, buttons
should never do very much except let the form know that they've been
clicked. So your button code should read:
def onHit(self, evt):
self.Form.createSpreadsheet()
That's it. Now add that method to the form, and since it needs data
from the bizobj, get the data, and do whatever formatting and
outputting of the data that you need.
> File "/tmp/tmpffgg6A.py", line 202, in onHit
> customerBizobj = self.CustomerBizobj.getBizobj()
> AttributeError: 'dButton_8999737196751547571' object has no attribute
> 'CustomerBizobj'
That's pretty self-expanatory. Since the code is executing as part of
the button, 'self' refers to the button.
-- 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]