On Friday 24 October 2008 12:11:48 pm Paul McNett wrote:
> johnf wrote:
> > Larry and I have a form that has the need to create bizobj's that use the
> > same data source (in this case 'public.aglots'). I believe this would be
> > a common requirement and Dabo should support.
> >
> >
> > The first bizobj uses several 'sum's in the select statement (has only
> > one row). The second bizobj is just a normal table (many rows). Both
> > use ' self.DataSource = "public.aglots" in the afterInit().
> >
> > We have two dGrids on the form. One where we use the aggregate bizobj
> > and the second uses the normal bizobj. Both are children. When we click
> > on the second grid we get an error that was traced to the following code
> > in dGrid:
> >
> > if not self.Form.moveToRowNumber(newRow, bizobj.DataSource):
> > dabo.ui.callAfter(self.refresh)
> >
> > The problem comes from using 'bizobj.DataSource'. In both bizobj's the
> > DataSource is the same ("public.aglots" ). So when the user clicks on
> > the grid with many rows Dabo uses ("public.aglots" ) to move to the row -
> > but finds the first one listed (in this case the bizobj with only one
> > row) and not the second one (the one with many rows).
> >
> > By removing the "DataSource" as in
> > self.Form.moveToRowNumber(newRow, bizobj) all works. But as complex as
> > dGrid and the relationship with bizobjs is - I not sure this is the
> > correct thing to do.
>
> It really isn't correct, I don't think (Ed?), because with form
> mediation we want the form to determine which bizobj to use.
>
> > Please review and hopefully provide some insight on the change or offer a
> > new suggestion.
>
> Change DataSource of each biz to be unique? AFAIK DataSource is only
> used for identification purposes, so name the first one "aglots_1" and
> the second one "aglots_2".
>
> Test with grid._mediateRowNumberThroughForm=False and see if your
> results are better.
>
> Paul
but does not dForm care of this in
def moveToRowNumber(self, rowNumber, dataSource=None):
""" Move the record pointer to the specified row."""
if isinstance(dataSource, dabo.biz.dBizobj):
bizobj = dataSource
else:
bizobj = self.getBizobj(dataSource)
if bizobj is None:
# Running in preview or some other non-live mode
return
return self._moveRecordPointer(bizobj.moveToRowNumber,
dataSource=bizobj,
rowNumber=rowNumber)
The form really wants the bizobj and not the 'DataSource'
--
John Fabiani
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]