FoxInCloud
wAfterRowChange
Gravatar is a globally recognized avatar based on your email address. wAfterRowChange
  Vincent H.
  All
  Jul 17, 2020 @ 10:44am

Hi Thierry,

Me again, with the same grid ...
The recordSource is a cursor with a candidate key and the records are in order of this key (SET ORDER TO ...)
When I move in the grid, I stay on the 1st record.
Of course, with this code, it works:

LPARAMETERS tuRow && see documentation in awGrd.wAfterRowChange()
IF (Type('m.thisForm.wlHTMLgen') == 'L' AND m.thisForm.wlHTMLgen)
   RETURN .T.
ENDIF
IF !DoDefault(@m.tuRow)
   RETURN
ENDIF
SEEK tuRow ORDER TAG Nomprecom IN Ccarnetadr
Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jul 18, 2020 @ 02:00am

Make sure to assign .recordSource with its candidate key, even without record, before or during grid.Init().

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 18, 2020 @ 02:27am

The cursor and its index are created in Form.Load()

Grid.RecordSource = MyCursor  
Grid.RecordSource.Type = 1

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jul 18, 2020 @ 02:30am

Grid.RecordSource = MyCursor

In form.Load()?

Grid gets created between form.Load() and form.Init()

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 18, 2020 @ 02:45am

Sorry for this imprecision
No, in grid properties

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jul 18, 2020 @ 02:49am

OK thanks

I understand you set grid.recordSource at design time

Please share the cursor creation code from form.Load()

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 18, 2020 @ 02:53am

Form.Load()

lParameters reminder_in_your_subclass_call_DoDefault_after_opening_all_views_and_cursorAdapters && {en} see sample impl. in awFrm code {fr} voir exemples impl. dans code de awFrm
DO SelectCarnet IN \VHDev\Appli\Courrier\Carnetadr WITH THISFORM, .F.
RETURN DODEFAULT()
PROCEDURE SelectCarnet
   LPARAMETERS Mform, lFiltre
   LOCAL Mfiltre
   Mfiltre = IIF (lFiltre = .F., ".F.", '.NOT. EMPTY (Idunique) .AND. Nom # "~" .AND. .NOT. EMPTY (Nom)')
   USE IN SELECT ("CCarnetadr")
   SELECT DISTINCT Nom, Prenom, Commune, Codepostal, Idunique FROM Carnetadr WHERE &Mfiltre INTO CURSOR CCarnetadr READWRITE NOFILTER
   INDEX ON PADR (ALLTRIM (Nom) + Espace + ALLTRIM (Prenom) + BlancTiret + ALLTRIM (Commune) + EspacePOuv + Codepostal + ParentFer + Espace + Idunique, 120) TAG Nomprecom COLLATE "General" CANDIDATE
   SET ORDER TO Nomprecom IN CCarnetadr
   GO TOP IN CCarnetadr
RETURN
Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jul 18, 2020 @ 03:02am

Please set a breakpoint at in grid.wcPKexprSet() and share debugger screenshot when it executes (with all windows visible, without public variables).

procedure wcPKexprSet

set step on

return dodefault()
Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 18, 2020 @ 03:13am

I must expand which node ?

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jul 18, 2020 @ 03:22am

none

please check used(this.recordSource) when execution stops, and resume until server returns to READ EVENTS

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 18, 2020 @ 03:26am

used(this.recordSource)

return .F.

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jul 18, 2020 @ 03:27am

the issue is here, please debug why the cursor is not used()

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 18, 2020 @ 03:53am

OK, I try ...

lparameters callBackMethod
WITH THISFORM
   IF .wlLAN .OR. .wlInitFirst
      DODEFAULT()
   ENDIF
   IF .wlInitFirst
      RETURN
   ENDIF
ENDWITH
DODEFAULT (m.callBackMethod)
suspend
? USED ("Ccarnetadr") => .T.
Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jul 18, 2020 @ 05:43am

You need to check in the ‘.wlInitFirst’ Section

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 18, 2020 @ 08:04am
lparameters callBackMethod
WITH THISFORM
   IF .wlLAN .OR. .wlInitFirst
      DODEFAULT()

suspend
? USED ("Ccarnetadr") => .T.

   ENDIF
   IF .wlInitFirst
      RETURN
   ENDIF
ENDWITH
DODEFAULT (m.callBackMethod)
Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jul 19, 2020 @ 01:54am

Vincent,

Let's go back to the basics… could you set a breakpoint as follows:

procedure wAfterRowChange

LPARAMETERS tuRow && see documentation in awGrd.wAfterRowChange()
IF (Type('m.thisForm.wlHTMLgen') == 'L' AND m.thisForm.wlHTMLgen)
   RETURN .T.
ENDIF
set step on && breakpoint here, remove others
IF !DoDefault(@m.tuRow)
   RETURN
ENDIF
SEEK tuRow ORDER TAG Nomprecom IN Ccarnetadr

step into DoDefault(@m.tuRow) until you reach the .wRowChange() procedure, step through this procedure (without stepping into the called procedures) and feedback which case is executed.

as you stay on the first record, you probably won't reach this case otherwise your alias would move to the last record:

otherwise
			locate for &lcPKexpr = m.tuRow
			success = Found()
…

please feedback the values of the main variables: tuRow and lcPKexpr.

TIA

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 19, 2020 @ 08:24am

not sure I understood everything ...

I introduce the set step on and in debugger I see that tuRow receive a correct value while lcPKexpr is always undefine

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  FoxInCloud Support - Thierry N.
  Vincent H.
  Jul 20, 2020 @ 02:28am

we could reproduce and pin down your issues; will include a fix in next beta

thanks for sharing the issues, and for your debugging efforts!

Gravatar is a globally recognized avatar based on your email address. re: wAfterRowChange
  Vincent H.
  FoxInCloud Support - Thierry N.
  Jul 20, 2020 @ 03:05am

Thanks to you 😃

© 1996-2024