On Aug 11, 2009, at 11:10 PM, [email protected] wrote:
> Entry for the seek method of dBizobj:
>
> seek(self, val, fld=None, caseSensitive=False, near=False,
> runRequery=True)
>
> What is the "self" given here as the first parameter? I only got the
> function to work when I dropped the self:
>
> bizRuns.seek(self.Form.txtRunID.Value,"run_id", False, True, True)
>
> (had an error saying I had too many parameters)
That is standard Python. Instance methods will have a reference to
the instance passed to it automatically by Python; by convention, this
parameter is called 'self'. When you see the method signature for any
instance method, you know that Python will add the parameter for
'self', and that your parameters will come after that.
> Also, while near=True worked, I couldn't get runRequery to do
> anything. I
> had to add a requery to the form to refresh the grid.
Bizobjs have nothing to do with the UI. When you call a bizobj method
from your form that could potentially change the data that should be
displayed on the form, you need to call self.update() in the form's
method after the bizobj call in order for the controls to be populated
with the latest state of the bizobj. The framework form methods do
this for you; that's why it's always better in the UI layer to call
form.requery() instead of bizobj.requery(): form.requery() will call
the bizobj's requery(), and then take care of updating the display.
When your code changes the bizobj's state, you have to call the form's
update() method to bring the UI back in sync.
-- Ed Leafe
_______________________________________________
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/[email protected]