Ed Leafe wrote:
> On Dec 12, 2008, at 11:21 AM, Bob Sysero llc Dev wrote:
>
>       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.
>   
>       That's pretty self-expanatory. Since the code is executing as part of  
> the button, 'self' refers to the button.
>
>
> -- Ed Leafe
>   
    The method you explained above is what I am using in
Method I that works without a problem.  Which is the easer
of the three methods. 

    In Method II  I am exploring the business rule or bizobjs
using both the Class Designer and cxn editor.  I know this
approach is not the best but my objective is to explore within
your Class Designer, a way to add a method within the
customerBizobj.py that was created by cxn editor in my biz dir.
I am trying to do this completely with the Class Designer and
editing the customerBizobj.py that will create the customer
spreadsheet based on my Business Rule in spreadSheetInBiz()
method. 

    Then on the Form that was created by the Class Designer,
I can have a Button that I can be pressed to create a spread Sheet
from the method in the customerBizobj.py called spreadSheetInBiz().
What I am trying to do is learn how to pass a DataSet that I beleave
was created in the customerBizobj.py under the class AfterInit. 

    From the error message:

AttributeError: 'dButton_8999737196751547571' object has no attribute
'CustomerBizobj'

I think it is telling me that there is no CustomerBizobj object define 
in the
scope of my code created by the Class Designer.  What I think is the
CustomerBizobj is within the framework of dabo if I am using the right
words.   Johnf said one way is to get the bizobj is to:

    custmerBizObj = self.getBizobj("Customer")
    custmerBizObj.spreadSheetInBiz()

This code code will be placed in my Button and in my CustomerBizobj.py I
would add a new method.  I think this will work and tonight I will try it.

    def spreadSheetInBiz(self)
        doc = ooolib.Calc()
        localDataSet = self.PrimaryBizobj.getDataSet()
        row_num=1
        for row in localDataSet:
           ............. So On ...........

     What I don't understand is back in the days I wrote C code the code
custmerBizObj.spreadSheetInBiz() would create a compile error on
the old NCR Tower using Unix.  the self arg would need to be passed
into the declared procedure.

    The last Method III is again a way to explore how I can interface a
module library  that will  contain  central classes and methods to interface
into the code created by the Class Designer.   What I am trying is how to
work within the Class Designer code with very specialized code that can
be swapped in and out based on the package being used on the central
core design.

    What my objected is to learn the inside out at best as I can with 
the Class
Designer.  This way what I learn my help others learn in using the Dabo 
Class
Designer as a whole.  Some times I have to fall on my face to learn.

Thank you
Bob


   







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

Reply via email to