Página 1 de 1

I don't like the new DbfDataSet

Publicado: Jue Ago 06, 2009 11:17 am
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

I don't like the new DbfDataSet

Publicado: Sab Ago 08, 2009 3:29 pm
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

I don't like the new DbfDataSet

Publicado: Sab Ago 08, 2009 3:29 pm
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

I don't like the new DbfDataSet

Publicado: Dom Ago 09, 2009 11:04 am
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
>

I don't like the new DbfDataSet

Publicado: Dom Ago 09, 2009 11:04 am
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
>