Subject Re: replace command
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Sat, 1 May 2021 13:26:13 -0700
Newsgroups dbase.getting-started

On 5/1/2021 1:21 PM, Gaetano D. wrote:
> On 2/05/2021 1:44, Mervyn Bick wrote:
>> On 2021/05/01 11:40, Gaetano D. wrote:
>>
>>> I just tried an entryfield inside a container object, and it does
>>> understand "form.rowset". I am lost now... I thought that direct
>>> parenthood was the dividing line... but obviously not. Since "this"
>>> means the entryfield in the entryfield's onChange event, and
>>> this.parent is the container, how does this entryfield inside the
>>> container know about the form object?
>>
>> I can't replicate this.
>>
>> In the attached example the entryfield's onChange event handler has no
>> problem writing to the form's rowset.
>>
>> Mervyn.
>
> that is what I was saying: "it DOES understand" :)
>
> I wonder why this awareness of the form could not be extended to the
> rowset "branch", after all the rowset is attached to a query that is
> attached to the form... I get that it works, but I don't get why it
> doesn't work for rowsets because they are attached to the form in the
> same way (as far as I can tell...).

The reasoning is that the data objects may be instantiated from a
datamodule, which might be in use in multiple forms (and/or reports),
may be instantiated in a program that calls a form, and so on. They
don't know what the form is for that reason. There are of course ways to
deal with that, applying a custom property to a query (or rowset), but ...

Ken


--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm