Page 1 of 1

Xbrowse, tDolphin, Cell edition problem and solution

PostPosted: Sun Feb 06, 2011 5:42 pm
by Adolfo
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: Select all  Expand view
    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

Re: Xbrowse, tDolphin, Cell edition problem and solution

PostPosted: Sun Feb 06, 2011 6:12 pm
by nageswaragunupudi
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?

Re: Xbrowse, tDolphin, Cell edition problem and solution

PostPosted: Sun Feb 06, 2011 7:19 pm
by Daniel Garcia-Gil
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, ::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 ) }


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

Re: Xbrowse, tDolphin, Cell edition problem and solution

PostPosted: Fri Apr 13, 2012 3:48 am
by goosfancito
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: Select all  Expand view
    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