XBrowse setget

XBrowse setget

Postby ADutheil » Thu Nov 07, 2019 10:29 am

Hi,

I'd like to know if it's possible to trigger an action when a setget field is changed in a XBrowse.

Tks
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: XBrowse setget

Postby nageswaragunupudi » Thu Nov 07, 2019 2:00 pm

This codeblock is called after a cell is edited and saved.
Code: Select all  Expand view  RUN

oCol:bOnSave( oCol, uOldValue )
 


In case of DBF, the record is locked, new value is saved, the codeblock bOnSave is evaluated and then the record is unlocked.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10653
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBrowse setget

Postby ADutheil » Thu Nov 07, 2019 2:09 pm

Thanks for the answer. I'll see what I can achieve with it.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: XBrowse setget

Postby ADutheil » Fri Nov 08, 2019 1:40 pm

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
------------------------------------------------------------------------
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: XBrowse setget

Postby nageswaragunupudi » Fri Nov 08, 2019 6:20 pm

I am extremely sorry.

It is not bOnSave.

It is bOnChange

oCol:bOnChange := { |oCol, uOldVal| yourcode }
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10653
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBrowse setget

Postby ADutheil » Fri Nov 08, 2019 6:37 pm

It works as expected now. Thanks a lot.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Otto and 85 guests