In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

I don't like the new DbfDataSet

Xailer professional forum in English
Responder
Ingo
Mensajes: 330
Registrado: Mié Jul 05, 2006 3:58 pm

I don't like the new DbfDataSet

Mensaje por Ingo »

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
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9469
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

I don't like the new DbfDataSet

Mensaje por ignacio »

Ingo,
You should set the value on the datacontrol. This is how is supposed to be
used.
But even if you modify the value of the field directly if there is a
datacontol linked to that same field it should also be updated. If you take
a look at method FieldPut you will see how is done:
IF !::lFast .AND. !::lOnUpdate .AND. ( lFromDC == NIL .OR. !lFromDC )
::UpdDataControlValue( n, x )
ENDIF
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
http:/xailer.info
"Ingo" <info@mandantwin.com> escribió en el mensaje de
noticias:4a7a9fc1$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> 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
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9469
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

I don't like the new DbfDataSet

Mensaje por ignacio »

Ingo,
You should set the value on the datacontrol. This is how is supposed to be
used.
But even if you modify the value of the field directly if there is a
datacontol linked to that same field it should also be updated. If you take
a look at method FieldPut you will see how is done:
IF !::lFast .AND. !::lOnUpdate .AND. ( lFromDC == NIL .OR. !lFromDC )
::UpdDataControlValue( n, x )
ENDIF
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
http:/xailer.info
"Ingo" <info@mandantwin.com> escribió en el mensaje de
noticias:4a7a9fc1$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> 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
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Ingo JH
Mensajes: 358
Registrado: Lun Dic 10, 2007 5:10 pm

I don't like the new DbfDataSet

Mensaje por Ingo JH »

Ignacio,
I'm using now the undocumented method UpdDataControlValue(n,x) instead
VarPut(n,x).
That has the effect I want.
I like the new DbfDataSet :).
Regards
Ingo
"Ignacio Ortiz de Zúñiga" <NoNameToAvoidSpam@xailer.com> schrieb im
Newsbeitrag news:[email=4a7d7dcb@svctag-j7w3v3j....]4a7d7dcb@svctag-j7w3v3j....[/email]
> Ingo,
>
>
> You should set the value on the datacontrol. This is how is supposed to be
> used.
>
> But even if you modify the value of the field directly if there is a
> datacontol linked to that same field it should also be updated. If you
> take a look at method FieldPut you will see how is done:
>
> IF !::lFast .AND. !::lOnUpdate .AND. ( lFromDC == NIL .OR. !lFromDC )
> ::UpdDataControlValue( n, x )
> ENDIF
>
> Regards,
>
> --
> Ignacio Ortiz de Zúñiga
> http://www.xailer.com
> http:/xailer.info
>
> "Ingo" <info@mandantwin.com> escribió en el mensaje de
> noticias:4a7a9fc1$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>> 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
>
Ingo JH
Mensajes: 358
Registrado: Lun Dic 10, 2007 5:10 pm

I don't like the new DbfDataSet

Mensaje por Ingo JH »

Ignacio,
I'm using now the undocumented method UpdDataControlValue(n,x) instead
VarPut(n,x).
That has the effect I want.
I like the new DbfDataSet :).
Regards
Ingo
"Ignacio Ortiz de Zúñiga" <NoNameToAvoidSpam@xailer.com> schrieb im
Newsbeitrag news:[email=4a7d7dcb@svctag-j7w3v3j....]4a7d7dcb@svctag-j7w3v3j....[/email]
> Ingo,
>
>
> You should set the value on the datacontrol. This is how is supposed to be
> used.
>
> But even if you modify the value of the field directly if there is a
> datacontol linked to that same field it should also be updated. If you
> take a look at method FieldPut you will see how is done:
>
> IF !::lFast .AND. !::lOnUpdate .AND. ( lFromDC == NIL .OR. !lFromDC )
> ::UpdDataControlValue( n, x )
> ENDIF
>
> Regards,
>
> --
> Ignacio Ortiz de Zúñiga
> http://www.xailer.com
> http:/xailer.info
>
> "Ingo" <info@mandantwin.com> escribió en el mensaje de
> noticias:4a7a9fc1$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>> 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
>
Responder