Subject Re: shortening references
From Gaetano <gaetanodd@hotmail.com>
Date Wed, 2 Sep 2020 08:42:53 +1000
Newsgroups dbase.getting-started


the 3 parent references take me back to a FORM object but my limited
understanding of object parenthood wrt SUBCLASSING doesn't allow me to
determine with certainty is whether that is base.cfm or customerForm.cfm

I think it should be customerForm because:

the 1st parent takes me from the form's rowset to the query level
the 2nd parent takes me to DMD level
the 3rd parent takes me to the form level of customerForm.wfm


Another thing that my limited understanding of object
parenthood/variable visibility doesn't enable me to understand is why I
cannot directly reference FORM.mytoolbar1 or customerForm.mytoolbar1 in
the canSave event.

Any guidance would be much appreciated.

Cheers,
Gaetano.

On 02/09/2020 07:32, Lee Grant wrote:
> Gaetano,
>
> It might just be a typo but.....
>
> On 9/1/2020 4:52 PM, Gaetano wrote:
>>
>> I am trying to shorten script references by creating a shortcut to the
>> FORM object. This is in the tutorial's customer.wfm form that is
>> subclassed from the base.cfm form, in case it matters.
>>
>> I found this suggestion from Michael Nuwer and Ken in an old post but
>> I am unable to implement it.
>>
>> -------------------
>> function from_onOpen
>               ^
> Could this be the problem?
>
>
>> this.fMytablename1=form.testdatamaodule1.Mytablename1.rowset.fields
>>
>> function whatever
>> form.fMytablename1["myfieldName"].value
>> --------------------
>>
>>
>> Essentially, in the canSave event of customer.wfm, I want to write
>> something like:
>>
>> oF.mytoolbar1.resetToolbar()
>>
>> instead of
>>
>> this.parent.parent.parent.mytoolbar1.resetToolbar()
>>
>> Thanks for your help.
>>
>> Cheers,
>> Gaetano.
>>
>