On Wednesday 26 December 2007 11:31 am, Ed Leafe wrote: > On Dec 26, 2007, at 1:09 PM, Adrian Klaver wrote: > > 1) Database contains record of interest. > > 2) Dabo.db using information from bizobj in Dabo.biz fetches a copy > > of record > > from database. > > 3) Bizobj via cursor/DataSet holds data as copy local to form. > > 4) Dabo.ui uses data in local copy to populate form elements. > > Correct in > > assuming this is pull operation on part of ui via update() method? > > Yes. > > > 5) User makes change in form data through a form element. > > 6) Memento system notes change and through update() pushes change > > in form to > > bizobj? > > No; calling update() would pull the data from the DataSource into > the UI. Pushing is accomplished by the flush() method, which pushes > the data from the control to its DataSource.
Good to know. I haven't stumbled across that one yet. > > Note that in 99.9% of cases, a developer should not have to *ever* > call update() or flush(). > > > 7) At this point changes can be pushed back to database by one of > > two paths. > > A) Use bizobj.save() > > Action is to save current record only? > > B) Use form.save() > > Seems to check for changes in all records in bizobj? > > To say that these are equivalent is wrong. From UI code, there is > only one option: calling the form's save() method. You should not get > in the habit of linking UI code directly to bizobj method calls, as > you'll at best be duplicating work already done, and at worst > tripping yourself up. I know that now. However when you are working through the api it is not that obvious. See reply to your next email for further comment. > > How form.save() behaves is completely under your control. There is a > property of the form named 'SaveAllRows'; its default value is True. > When True, calling form.save() results in a call to bizobj.saveAll(), > which saves all changes rows; when SaveAllRows is False, calling > form.save() results in a call to bizobj.save(), which will save the > current row if it has pending changes. Now I understand. Again see reply to next email for further comment. > > > 8) Bizobj can have local copy of data updated by one of two paths. > > A) Use bizobj.requery() > > Repopulates bizobj data only > > B) Use form.requery() > > Repopulates bizobj data and updates form data. > > The former should only be called in your code when you are coding at > the bizobj level. In your UI code, you should only code the latter. > > -- Ed Leafe -- Adrian Klaver [EMAIL PROTECTED] _______________________________________________ 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]
