Because of just edit a single field, I wanted to use < oCol:bOnPostEdit >
As soon I edit the field ( after RETURN ), there is a error.
A normal read / save in the network is no problem.
The record is locked and I get a Error : Lock required.
What is wrong with this line ?
- Code: Select all Expand view
//---------- at Start ----------------------
REQUEST DBFCDX
Rddsetdefault("DBFCDX")
IF !FILE(c_Path + "\WRITE.DBF")
aStru := { {"TYPE","C", 7, 0}, ;
{"FORMAT","C", 30, 0}, ;
{"EXTENSION","C", 5, 0}, ;
{"INFO","C", 70, 0}, ;
{"SORT","C", 3, 0}}
DBCREATE("&c_Path\WRITE.DBF", aStru)
NET_APPEND( 5, 5 ) // Network-function
ENDIF
DBSELECTAREA(2)
IF NET_USE(c_Path + "\WRITE.DBF", 5, 5,.T.) // Network-function
ORDCREATE( ,"WRITE","SORT", {|| SORT } , .F. )
ELSE
MsgAlert( "Error open Format-File","Format-File")
RETURN( NIL )
ENDIF
// ------ Inside a function ----------------------------
DBSELECTAREA(2)
DBSETORDER(1)
DBGOTOP()
oLbx7 := TXBrowse():New( oFolder:aDialogs[2] )
oLbx7:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oLbx7:nColDividerStyle := LINESTYLE_BLACK
oLbx7:nRowDividerStyle := LINESTYLE_BLACK
oLbx7:nRecSelColor = 15512898
oLbx7:bClrSelFocus = { || { 16777215, 15512898 } }
oLbx7:bClrSel = { || { 16777215, 15512898 } }
oCol := oLbx7:AddCol()
oCol:cHeader := "Sort"
oCol:bStrData := { || (2)->SORT }
oCol:nWidth := 50
oCol:bEditValue := { || (2)->SORT }
oCol:bOnPostEdit := {|oCol, xVal, nKey | ;
IF( nKey == VK_RETURN, ( DBRLOCK(), (2)->SORT := xVal, DBUNLOCK() ),) }
oLbx7:SetRDD()
oLbx7:CreateFromResource( 110 )
Error description: Error DBFCDX/1022 Lock required
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:POSTEDIT(0)
Called from: .\source\classes\XBROWSE.PRG => EDITGETLOSTFOCUS(0)
Called from: .\source\classes\XBROWSE.PRG => (b)TXBRWCOLUMN:EDIT(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:LOSTFOCUS(0)
Called from: .\source\classes\CONTROL.PRG => (b)TCONTROL:TCONTROL(0)
Called from: => TCONTROL:LOSTFOCUS(0)
Called from: .\source\classes\TGET.PRG => TGET:LOSTFOCUS(0)
Called from: .\source\classes\CONTROL.PRG => TGET:KILLFOCUS(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
Called from: .\source\classes\TGET.PRG => TGET:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => SYSREFRESH(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:KEYCHAR(0)
Called from: .\source\classes\TGET.PRG => TGET:KEYCHAR(0)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
Called from: .\source\classes\TGET.PRG => TGET:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(0)
Regards
Uwe