Subject Re: on_navigate with mastersource and masterfields why diffrence
From Dirk C <dirk@C.com>
Date Sat, 11 May 2024 22:50:04 +0200
Newsgroups dbase.getting-started


Mervyn,

  for what it's worth, i noted some incompleteness and double
  implementations, but now it's working like i want to

  sometimes a word is enough

  thanks again,

  Dirk,


Op 10/05/2024 om 17:42 schreef Mervyn Bick:
> On 2024/05/09 23:16, Dirk C wrote:
>> hello to you,
>>
>> a explanation needed
>>
>>   when i use this query with masterfields, rowset_onnavigate is working
>>
>>   well
>>
>>   but if i use mastersource the rowset onnavigate is following aswell
>> but!
>>
>> only one step later,
>
>
> I can see what is happening and the work-around is to add a requery for
> VRAAGBAK_AFMETING in the onNavigate event handler.
>
> function rowset_onNavigate1(type, nRows)  // vraagbak_crossen
>    this.parent.parent.vraagbak_afmeting.requery()
>    if
> empty(this.parent.parent.vraagbak_afmeting.rowset.fields["afmvolgnr"].value)
>      this.parent.parent.DOOS_AFMETING.KNOP_AFMETING_INGAVE.visible = true
>       ?"test true"
>    else
>     this.parent.parent.DOOS_AFMETING.KNOP_AFMETING_INGAVE.visible = false
>       ? "test false"
>     endif
>     return
>
> It does, however, look as if you are doing something that is most
> unusual.  Mastersource is usually used to fetch many records from the
> child table where a field in the child table contains the same value as
> the value in a single record of the parent table.
>
> Even though there may be many matching records in the child table, your
> onNavigate event handler for the parent query will only ever look at the
> first of possibly many child records.
>
> Mervyn.
>
>
>
>