On Tuesday 19 January 2010 10:29:11 am Jacek Kałucki wrote:
> Użytkownik John napisał:
> > Hi,
> >
> > I have taken a little time to review what JacekK is doing with his
> > example that shows his issue (ticket 1314).  The record pointer moves
> > (incorrectly) when he selects the browse tab.
> >
> > I noticed that he was not executing a requery() as one of the final items
> > from a list of items I thought were required.  In his second example he
> > added a dForm.RequeryOnLoad which calls
> > "dabo.ui.callAfter(self.requery)".
> >
> > If I add the method afterInitAll() (to his second example) and issue a
> > self.refresh() all works as I would expect - that is
> > 1. the data is displayed correctly in textboxes
> > 2. the textboxes relate to the grid correctly (on the browse tab)
> > 3. the VCR controls work correctly moving the record pointer.
> >
> > These facts bring up several questions in my mind.
> >
> > The framework requires that a requery() be executed after all the UI is
> > completed it's layout - is that correct?  Therefore, there is a timing
> > issue. If it is correct (and I believe it is) why don't the doc's say so
> > somewhere? Is there a reason we don't issue the requery() and refresh()
> > immediately after the UI layout?
> >
> > JacekK form creates the data dynamically for the bizobj.  And after a
> > requery() the record pointer rest on the last record created.  The bizobj
> > has no "order by"  so I intuitively understood that it would be on the
> > last record entered.  But then I started to question that thought.  All
> > other demo's I've seen refresh the bizobj to the first record not the
> > last.  The demo's always used real database examples or were hard coded
> > datasets.  Why, would it make a difference?  That is, what is causing the
> > record pointer to rest on the last record vs the first record?
>
> The row pointer is in middle of dataset, precisely, it points second
> row from the end in my example.
> Requery doesn't change anything because it restores pointer.
> Remember that controls on dPage object aren't istantiated
> while requery takes place.
> I think it's pure dGrid issue, not the general data handling issue.
> I noticed strange behaviour under debugger.
> Some grids works correctly, I mean there is no _onGridCellSelected()
> method call at instantiation for CurrentRow=-1.
> But there are few others where it happens and I don't know why.

I believe there a few underlying issues.  requery and refresh are not 
providing the desired results even when you set 'RequeryOnLoad = True'.  But 
they do work from the dShell after all the UI is done.  Also I noticed that 
the refresh sets the record pointer to record 4 (the last record) but I have 
not seen this occur in the past with other demo code.

Your code is artificial and I do not believe it is the normal case for Dabo.  
Normally, the database would not be created and populated on the fly.  This 
may account for the pointer being on record 4.  Using your code to access a 
real database all worked as expected. But like you I don't understand why.  I 
guess I never really looked into the issue because I always use real data in 
my apps.  I also ask the user to retreive the record in question which then 
sets all the relationships up correctly.  So my apps would never have noticed 
the record pointer being wrong for the grids.  

BTW all of this maybe outside of Dabo.  Maybe something to do with wx.Grid?

Johnf

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

Reply via email to