Carl Karsten wrote: > Paul McNett wrote: >> Ed Leafe wrote: >>> On Jun 12, 2007, at 12:30 PM, Paul McNett wrote: >>> >>>> This isn't mediated through the form, even though 'self' is the form. >>> OK, then, explain the difference between a direct reference to the >>> bizobj, and constantly asking the form for the reference. How is that >>> "mediating"? >> It is clear that I misunderstood this entire thread. However, to answer >> your question, take these two options: >> >> 1) grid.DataSource = biz ## direct biz ref. >> >> --or-- >> >> 2) grid.DataSource = biz.DataSource ## indirect biz ref. >> >> >> In #1, the grid will call biz.requery(), biz.moveToRowNum(), etc. In #2 >> the grid will call form.requery(self.DataSource), >> form.moveToRowNum(self.DataSource), etc. > > huh? > > Not that I disagree, it is just surprising. what code decides what to call? > (biz.X vs form.X)
Ok, I need to clarify: 1) dGrid *never* calls requery(). 2) The *only* form method called if possible is moveToRowNum(): if the form is available and it has a bizobj with the grid's DataSource, *and* if the grid's DataSource isn't a direct bizobj reference.[1] The place where this decision happens: http://svn.dabodev.com/trac/dabo/browser/trunk/dabo/ui/uiwx/dGrid.py#L3035 When the cell is selected, the grid needs to tell the underlying bizobj what row to go to. In the first case (form mediates), the form will return False if the row couldn't be moved to. The grid refreshes, which places the cell selection on whatever row the bizobj reports it is on currently. In the second case (biz mediates), we trap the error and call grid.refresh(). [1] See latest commit which fixes this -- pkm ~ http://paulmcnett.com _______________________________________________ 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/dabo-users/[EMAIL PROTECTED]
