I don't like the new DbfDataSet
Publicado: Jue Ago 06, 2009 11:17 am
Ignacio,
I'm using now FieldPut instead VarPut but the DataControls in the form don't
show the new values not before oDateset:Update() is called.
How to make the DataControls showing the new values without writing them to
the database.
I don't like to assign manually each single DataControl:Value. That's too
much work to rewriting the code each app
Here is one code-snippet like I'm using:
METHOD BtnBmp1Click( oSender ) CLASS TMP5Edit
LOCAL aR, n, z := ::oMP5:FieldCount()
WITH OBJECT Gerichtsliste():New(self) //get datas from another database
browsed in a form
IF :ShowModal() = mrOK
aR := :Cargo
ENDIF
:End()
END WITH
IF aR # NIL .AND. LEN(aR) = z
WITH OBJECT ::oMP5 //the target database is already in editmode
FOR n := 1 TO Z
:FieldPut( n, aR[n] ) //instead old VarPut()
LogDebug( :FieldGet( n ) ) //the debugger window shows the new value
/*
:aFields[n]:Value := aR[n] //trying the other way
LogDebug( :aFields[n]:Value ) //the debugger window shows the new value too
*/
NEXT
END WITH
ENDIF
RETURN Nil
Regards
Ingo
I'm using now FieldPut instead VarPut but the DataControls in the form don't
show the new values not before oDateset:Update() is called.
How to make the DataControls showing the new values without writing them to
the database.
I don't like to assign manually each single DataControl:Value. That's too
much work to rewriting the code each app
Here is one code-snippet like I'm using:
METHOD BtnBmp1Click( oSender ) CLASS TMP5Edit
LOCAL aR, n, z := ::oMP5:FieldCount()
WITH OBJECT Gerichtsliste():New(self) //get datas from another database
browsed in a form
IF :ShowModal() = mrOK
aR := :Cargo
ENDIF
:End()
END WITH
IF aR # NIL .AND. LEN(aR) = z
WITH OBJECT ::oMP5 //the target database is already in editmode
FOR n := 1 TO Z
:FieldPut( n, aR[n] ) //instead old VarPut()
LogDebug( :FieldGet( n ) ) //the debugger window shows the new value
/*
:aFields[n]:Value := aR[n] //trying the other way
LogDebug( :aFields[n]:Value ) //the debugger window shows the new value too
*/
NEXT
END WITH
ENDIF
RETURN Nil
Regards
Ingo