On Dec 23, 2007, at 7:51 PM, Adrian Klaver wrote:

>>      Yes. When you changed the table in the backend, the data in the
>> bizobj is now out-of-date. You would have to call requery() to get
>> the latest values in the database.
>
> Then maybe you can clear up something for me. In the api docs the  
> dForm.update
> method has the following description:
>
> update(self, interval=None)
>
> Updates the contained controls with current values from the source.
>
> <snip>
>
> I assumed the source was the table to which the bizobj refers.  
> Therefore I
> thought when I did self.update() it would go back to the table for the
> values. Am I to understand that the source is the cursor/DataSet  
> and that in
> order to get fresh values in a form control I have to call requery 
> () in order
> to refresh the data in the cursor/DataSet and hence the form?

        The source is the bizobj; i.e., the 'DataSource'. The update()  
method is called frequently; it would not be wise to have it  
constantly requerying the database.

        There's another good reason not to behave that way: let's say you  
run a query and get back 10 records. You change the name in the first  
record from 'Smith' to 'Jones'; now the bizobj has 'Jones' for the  
name, but the database has 'Smith', since you haven't saved your  
changes yet. Then you call next() to move to the next record; update 
() is called to refresh the controls with Record #2's values, so now  
the name field shows 'Baker', which is the name of record 2. After a  
while you call prior() to go back to the first record (the one that  
you modified); update() is again called to change the controls to  
display the values for Record #1. But what should be displayed in the  
name field? The original value in the database, or the modified value  
in the bizobj?

        I think that if anything but the modified value in the bizobj were  
to show, there would be a lot of angry users whose changes were being  
erased by Dabo.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.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]

Reply via email to