Subject Re: replace command
From Andy Taylor <andy.taylor.1959@outlook.com>
Date Sat, 01 May 2021 09:56:38 -0400
Newsgroups dbase.getting-started

Gaetano,

All controls designed for use on a form know what "form" refers to irrespective of how deep they are in containers, notebooks, etc.
If you put them on a sub-form however... they think that "form" refers to the sub-form not the parent form.

It's the non-visual objects that might have the problem with not being able to recognise form, like rowset.

Regards,
Andy

> On 1/05/2021 18:59, Akshat Kapoor wrote:
> > Good Afternoon Gaetano,
> >>
> >> I just tried it and the entryfield event seems to be aware of the
> >> form.rowset object, so I guess that option 1 (and akshat's option)
> >> should work, but I was confused as to why it does work...
> >>
> >> So I went to Ken's books and I think I found the answer... anything
> >> instantiated with (this) in a form and its event handlers, e.g.
> >> this.entryfield1 = new entryfield(this) and entryfield1's onchange
> >> event would know what "form.rowset" is. Does that sound right, Ken?
> >
> > .parent notation is required with methods/events related to the rowset
> > object like canGetRow / canNavigate etc.
> >
> > Visual controls recognise the form object.
> >
> > Regards
> > Akshat
>
> Good afternoon Akshat,
>
> 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?
>
> Cheers,
>
> Gaetano.
>