I have created a vcr class with the common first,prior,next and last buttons.  
However, it is not based on the PKID but on a field.  If I click on my next 
or prior buttons in a normal manner all works.  But I quickly click on either 
of the buttons at some random point a save dialog will pop up.  

def vcrPrior(self):
                #self.mybiz=self.Form.getBizobj("public.arcust")
                if self.mybiz.RowCount ==0:
                        self.Form.notifyUser("No records in data set")
                        return
                curCust=self.mybiz.getFieldVal(self.lkfield)
                self.mybiz.UserSQL=("select * from %s where %s < '%s' order by 
%s desc limit 
1" % (self.vcrTable,self.lkfield,curCust,self.lkfield))
                self.Form.requery()
                if self.mybiz.RowCount <= 0:
                        self.Form.notifyUser("No Prior record in data set")
                        self.vcrFirst()
                self.Form._setEditMode(self.mybiz.RowCount>0)
                
        def vcrNext(self):
                #self.mybiz=self.Form.getBizobj("public.arcust")
                if self.mybiz.RowCount ==0:
                        self.Form.notifyUser("No records in data set")
                        return
                curCust=self.mybiz.getFieldVal(self.lkfield)
                oldsql=self.mybiz.CurrentSQL
                self.mybiz.UserSQL=("select * from %s where %s > '%s' order by 
%s limit 1" % 
(self.vcrTable,self.lkfield,curCust,self.lkfield))
                self.Form.requery()
                if self.mybiz.RowCount <= 0:
                        self.Form.notifyUser("No Next record in data set")
                        self.vcrLast()

                self.Form._setEditMode(self.mybiz.RowCount>0)
                

In my bizobj I also have:

 def afterRequery(self):
        if self.Parent <> None and self.RowCount==0:
            self.new()  #add a new child it does not exist

Does anyone have an idea as to why rapid clicking would cause the form to 
assume data had changed?


-- 
John Fabiani

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to