On Sunday 23 December 2007 4:15 pm, Ed Leafe wrote:
> On Dec 23, 2007, at 5:31 PM, Adrian Klaver wrote:
> > 1) Given-
> > bz=self.PrimaryBizobj
> > bz.moveTo RowNumber(45)
> > self.update(0)
> > Is this the best way to bring the UI in sync with the bizobj?
>
>       Calling the form's update() method should refresh the data-bound
> controls with the current values of the objects to which they are
> bound. Are you seeing any problems, or just asking a general question
> about recommended practices?

Just asking if this was best practice.  To answer John, update(0) is an 
artifact of my experimenting.

> > 2) I updated a field in a table from psql. I then ran self.update
> > (0) against
> > the form that pointed to that table. I expected to see the field value
> > changed to reflect the update in the backend, but it was not. Am I
> > missing
> > something?
>
>       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?


>
> > 3) Am I correct in assuming bizobj.seek() only does exact matches (the
> > caseSensitive & near options notwithstanding). In other words I cannot
> > do '%mint%'?
>
>       It's not 'exact'; it's more like a string.startswith() search. IOW,
> you could seek for the equivalent of 'mint%' by seeking 'mint'; it
> will return the first record that equals 'mint', and if 'near' is
> True, it will return the first record that begins with 'mint' or the
> closest record that is not alphabetically greater than 'mint'.
>
>       The typical use for seek() is when you have a bunch of data and
> start entering characters to locate the desired record. For example,
> if you have a bunch of names and want to let the user start typing a
> few characters to locate the desired name, you would use seek() with
> near==True to move them to the closest record that matches what
> they've typed.
>
>       Does that help?

Yes. 

Thanks John for pointing me in the right direction as to an alternate method 
of searching.
>
> -- Ed Leafe
> -- http://leafe.com
> -- http://dabodev.com
>
>
>
>
[excessive quoting removed by server]

_______________________________________________
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