On Thursday 29 October 2009 05:18:12 am Ed Leafe wrote:
> On Oct 27, 2009, at 10:36 PM, Aaron Carlow wrote:
> > I'm admittedly new at Python and programming in general but not
> > totally
> > without understanding.  However, I'm am completely and utterly
> > frustrated
> > with how I'm supposed to handle the following situation:
> >
> > 1) A single form
> > 2) Multiple tabs (dPages)
> > 3) Each tab with it's own table and associated bizObj
> >
> > How in the world am I supposed to assign a bizObj to a dPage/dGrid?
> > I've
> > spent literally hours banging my head against the wall, searching this
> > newsgroup, reading the API docs, the tutorials, screencasts, etc.
> > What am I
> > missing?!
> >
> > I've tried to do the following in dForm.createBizobs():
> >
> > bizAddEvent = self.Application.biz.EventBizobj(conn,
> > DataSource="AddEvent")
> > self.addBizobj(bizAddEvent)
> > self.bizAddEventDS = bizAddEvent.DataSource
>
>       You do not need that last line. The bizobj itself is the data source
> for your controls.
>
> > bizModifyEvent = self.Application.biz.EventBizobj(conn,
> > DataSource="ModifyEvent")
> > self.addBizobj(bizModifyEvent)
> > self.bizModifyEventDS = bizModifyEvent.DataSource
> >
> > bizModifyExhibitor = self.Application.biz.ExhibitorBizobj(conn,
> > DataSource="ModifyExhibitor")
> > self.addBizobj(bizModifyExhibitor)
> > self.bizModifyExhibitorDS = bizModifyExhibitor.DataSource
> >
> > The idea being that I would use the self.??????DS object in the
> > dGrid.DataSource property but I get no data.  Am I even close to
> > doing this
> > the right way?
>
>       Just set the DataSource for the controls (grid or anything else) to
> the same string as the bizobj's DataSource. E.g.:
>
> gridExhibitor.DataSource = "ModifyExhibitor"
>
>       Also, I might be reading too much into your names, but it looks like
> you have different bizobjs for read and write operations. That is not
> necessary and probably a bad idea. If you explain a bit what you're
> trying to accomplish, we might be able to give you some guidance for
> designing your tables and bizobjs.
>
>
> -- Ed Leafe

In addition to what Ed said make sure somewhere in your code you requery the 
database.  Requery will retrieve the data - it's a simple bit of code often 
missed by newbies.  This is normally done in the Form.afterInit() but can be 
done from other methods.

def afterInit(self):
    self.requery()

If you are using ClassDesigner make sure your grid control's  'DataSource' 
contains a value such as "AddEvent" (I think that's the name of one of the 
tables)  and that you add a database field value for each of the grids 
columns 'DataField'.  The Dabo framework will fill the grid with data.   Of 
course the same is true if you hand code your forms.


Don't get to frustrated ask questions here.  We'll help.  
Johnf










_______________________________________________
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