Page 1 of 1
XBrowse setget
Posted: Thu Nov 07, 2019 10:29 am
by ADutheil
Hi,
I'd like to know if it's possible to trigger an action when a setget field is changed in a XBrowse.
Tks
Re: XBrowse setget
Posted: Thu Nov 07, 2019 2:00 pm
by nageswaragunupudi
This codeblock is called after a cell is edited and saved.
In case of DBF, the record is locked, new value is saved, the codeblock bOnSave is evaluated and then the record is unlocked.
Re: XBrowse setget
Posted: Thu Nov 07, 2019 2:09 pm
by ADutheil
Thanks for the answer. I'll see what I can achieve with it.
Re: XBrowse setget
Posted: Fri Nov 08, 2019 1:40 pm
by ADutheil
I tried the following:
oBrw1:aCols[ 4 ]:SetCheck( ) // works OK
When I add the folowing line the system crashes while opening the browse.
oBrw1:aCols[ 4 ]:bOnSave := { || msgInfo( "Hi" ) }
The error log is:
Application Internal Error - D:\xProjetos\VavAta\VAVATA.EXE
Terminated at: 2019-11-08 10:23:31
Erro irrecuper vel 9003: Muitas chamadas recursivas ao manipulador de erros
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(317) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(23) in .\source\function\ERRSYSW.PRG
Called from _CLSSETERROR(247) in .\source\function\HARBOUR.PRG
Called from TXBRWCOLUMN:_BONSAVE(15912) in .\source\classes\XBROWSE.PRG
Called from DIGITAENC(421) in .\SOURCES\VAV_ENC.PRG
Called from (b)DGTENCALHE(386) in .\SOURCES\VAV_ENC.PRG
Called from TBUTTON:CLICK(179) in .\source\classes\BUTTON.PRG
Called from TBUTTON:HANDLEEVENT(1755) in .\source\classes\CONTROL.PRG
Called from _FWH(3513) in .\source\classes\WINDOW.PRG
Called from SENDMESSAGE(0)
Called from TDIALOG:COMMAND(433) in .\source\classes\DIALOG.PRG
Called from TWINDOW:HANDLEEVENT(0)
Called from TDIALOG:HANDLEEVENT(1136) in .\source\classes\DIALOG.PRG
Called from DIALOGBOX(0)
Called from TDIALOG:ACTIVATE(304) in .\source\classes\DIALOG.PRG
Called from DGTENCALHE(389) in .\SOURCES\VAV_ENC.PRG
Called from (b)BUILDMENU(80) in .\SOURCES\VAVATA.PRG
Called from TMENU:COMMAND(1552) in .\source\classes\MENU.PRG
Called from TWINDOW:COMMAND(1109) in .\source\classes\WINDOW.PRG
Called from TMDIFRAME:COMMAND(262) in .\source\classes\MDIFRAME.PRG
Called from TMDIFRAME:HANDLEEVENT(0)
Called from _FWH(3513) in .\source\classes\WINDOW.PRG
Called from WINRUN(0)
Called from TMDIFRAME:ACTIVATE(1065) in .\source\classes\WINDOW.PRG
Called from MAIN(55) in .\SOURCES\VAVATA.PRG
------------------------------------------------------------------------
Re: XBrowse setget
Posted: Fri Nov 08, 2019 6:20 pm
by nageswaragunupudi
I am extremely sorry.
It is not bOnSave.
It is bOnChange
oCol:bOnChange := { |oCol, uOldVal| yourcode }
Re: XBrowse setget
Posted: Fri Nov 08, 2019 6:37 pm
by ADutheil
It works as expected now. Thanks a lot.