FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xbrowse, tDolphin, Cell edition problem and solution
Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
Xbrowse, tDolphin, Cell edition problem and solution
Posted: Sun Feb 06, 2011 05:42 PM
Fivewinners...
Here there is a solution for a problem found qhen you try to edit a cell in xBrowse using tDolhpin queries

Change this in SetColFromMysql from class xBrowse

Code (fw): Select all Collapse
     If ::oMySql:IsKindOf( "TDOLPHINQRY" )
        oCol:bOnPostEdit      :=  { |o,x,n| If( n == VK_RETURN,( ::oMySql:FieldPut( nCol, x ), ::oMySql:Save() ),  NIL ) }
     Else
        oCol:bOnPostEdit      := { |o,x,n| If( n == VK_RETURN, ::onedit( o, x, n, cType, nCol ), NIL ) }
     Endif


Then you can edit the cell and save its value.
This was discovered by Daniel Garcia-Gil, after some minutes bothering him...

Greetings
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse, tDolphin, Cell edition problem and solution
Posted: Sun Feb 06, 2011 06:12 PM

Mr. Daniel

I am wondering where is this "onedit" method declared. I do not find it anywhere in the TXBrowse class.

To bring SetMySql ( for Dolphin ) method also inline with other Set... methods, I would suggest these modifications instead.

(for Dolphin)
oCol:bEditValue := { |x| If( x != nil, ::oMySql:FieldPut( nCol, x ),), ::oMysql:FieldGet( nCol ) }
oCol:cDataType := If( cType == nil, 'C', cType )
oCol:bOnPostEdit := { |o,x,n| If( n == VK_RETURN, o:Value := x, nil ) }
and in the SetMySql method:
::bOnRowLeave := { || ::oMySql:Save() }

Would u mind checking if this is working well? Does FieldPut() method in Dolphin take care of Readonly cursors?

Regards



G. N. Rao.

Hyderabad, India
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Xbrowse, tDolphin, Cell edition problem and solution
Posted: Sun Feb 06, 2011 07:19 PM
Mr. Rao

nageswaragunupudi wrote:I am wondering where is this "onedit" method declared. I do not find it anywhere in the TXBrowse class.

Really i didnt found "onedit" method... this code have so many time from was created "method SetColFromMySQL"... i tried use for Dolphin without take care (sorry)

nageswaragunupudi wrote:oCol:bEditValue := { |x| If( x != nil, ::FieldPut( nCol, x ),), ::FieldGet( nCol ) }
oCol:cDataType := If( cType == nil, 'C', cType )
oCol:bOnPostEdit := { |o,x,n| If( n == VK_RETURN, o:Value := x, nil ) }


no work, we need save after modify value

nageswaragunupudi wrote:Does FieldPut() method in Dolphin take care of Readonly cursors?

Dolphin check in save method, but the user can check by himself before FieldPut
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: Xbrowse, tDolphin, Cell edition problem and solution
Posted: Fri Apr 13, 2012 03:48 AM
Adolfo, para que version de xbrowse es esto?

gracias.

Adolfo wrote:Fivewinners...
Here there is a solution for a problem found qhen you try to edit a cell in xBrowse using tDolhpin queries

Change this in SetColFromMysql from class xBrowse

Code (fw): Select all Collapse
     If ::oMySql:IsKindOf( "TDOLPHINQRY" )
        oCol:bOnPostEdit      :=  { |o,x,n| If( n == VK_RETURN,( ::oMySql:FieldPut( nCol, x ), ::oMySql:Save() ),  NIL ) }
     Else
        oCol:bOnPostEdit      := { |o,x,n| If( n == VK_RETURN, ::onedit( o, x, n, cType, nCol ), NIL ) }
     Endif


Then you can edit the cell and save its value.
This was discovered by Daniel Garcia-Gil, after some minutes bothering him...

Greetings
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/

Continue the discussion