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.
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.
DBFBrowse nRecSel after Append
DBFBrowse nRecSel after Append
Dear developers!
I try to append record into DBFBrowse with lAutoSave==.f. (see attached
sample). Now all is working except the following.
I have table with index on field->nomerpr. When I append record with with
field->nomerpr:=maximum_value, DBFBrowse sets cursor on new record after
append. But when I append record with with field->nomerpr:=not_maximum_value
(in the middle of values), DBFBrowse does not sets cursor on just appended
record. How can I avoid this? I always want to set cursor onto just appended
record.
Can you look at this? Just click 'Append' button, enter 120 into first
field, anything into second and press Enter.
Regards, Oleg.
Attached files test25.zip (2.5 KB)Â
I try to append record into DBFBrowse with lAutoSave==.f. (see attached
sample). Now all is working except the following.
I have table with index on field->nomerpr. When I append record with with
field->nomerpr:=maximum_value, DBFBrowse sets cursor on new record after
append. But when I append record with with field->nomerpr:=not_maximum_value
(in the middle of values), DBFBrowse does not sets cursor on just appended
record. How can I avoid this? I always want to set cursor onto just appended
record.
Can you look at this? Just click 'Append' button, enter 120 into first
field, anything into second and press Enter.
Regards, Oleg.
Attached files test25.zip (2.5 KB)Â
- ignacio
- Site Admin
- Mensajes: 9469
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
DBFBrowse nRecSel after Append
Oleg,
Just do the following:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
lCanceled := .t.
RETURN Nil
This way you are telling the class to do nothing after your manual append
operation.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465ad0df@ozsrv2.ozlan.local...]465ad0df@ozsrv2.ozlan.local...[/email]
> Dear developers!
>
> I try to append record into DBFBrowse with lAutoSave==.f. (see attached
> sample). Now all is working except the following.
>
> I have table with index on field->nomerpr. When I append record with with
> field->nomerpr:=maximum_value, DBFBrowse sets cursor on new record after
> append. But when I append record with with
> field->nomerpr:=not_maximum_value
> (in the middle of values), DBFBrowse does not sets cursor on just appended
> record. How can I avoid this? I always want to set cursor onto just
> appended
> record.
>
> Can you look at this? Just click 'Append' button, enter 120 into first
> field, anything into second and press Enter.
>
> Regards, Oleg.
>
>
>
>
>
>
Just do the following:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
lCanceled := .t.
RETURN Nil
This way you are telling the class to do nothing after your manual append
operation.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465ad0df@ozsrv2.ozlan.local...]465ad0df@ozsrv2.ozlan.local...[/email]
> Dear developers!
>
> I try to append record into DBFBrowse with lAutoSave==.f. (see attached
> sample). Now all is working except the following.
>
> I have table with index on field->nomerpr. When I append record with with
> field->nomerpr:=maximum_value, DBFBrowse sets cursor on new record after
> append. But when I append record with with
> field->nomerpr:=not_maximum_value
> (in the middle of values), DBFBrowse does not sets cursor on just appended
> record. How can I avoid this? I always want to set cursor onto just
> appended
> record.
>
> Can you look at this? Just click 'Append' button, enter 120 into first
> field, anything into second and press Enter.
>
> Regards, Oleg.
>
>
>
>
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
DBFBrowse nRecSel after Append
Oleg,
Just do the following:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
lCanceled := .t.
RETURN Nil
This way you are telling the class to do nothing after your manual append
operation.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465ad0df@ozsrv2.ozlan.local...]465ad0df@ozsrv2.ozlan.local...[/email]
> Dear developers!
>
> I try to append record into DBFBrowse with lAutoSave==.f. (see attached
> sample). Now all is working except the following.
>
> I have table with index on field->nomerpr. When I append record with with
> field->nomerpr:=maximum_value, DBFBrowse sets cursor on new record after
> append. But when I append record with with
> field->nomerpr:=not_maximum_value
> (in the middle of values), DBFBrowse does not sets cursor on just appended
> record. How can I avoid this? I always want to set cursor onto just
> appended
> record.
>
> Can you look at this? Just click 'Append' button, enter 120 into first
> field, anything into second and press Enter.
>
> Regards, Oleg.
>
>
>
>
>
>
Just do the following:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
lCanceled := .t.
RETURN Nil
This way you are telling the class to do nothing after your manual append
operation.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465ad0df@ozsrv2.ozlan.local...]465ad0df@ozsrv2.ozlan.local...[/email]
> Dear developers!
>
> I try to append record into DBFBrowse with lAutoSave==.f. (see attached
> sample). Now all is working except the following.
>
> I have table with index on field->nomerpr. When I append record with with
> field->nomerpr:=maximum_value, DBFBrowse sets cursor on new record after
> append. But when I append record with with
> field->nomerpr:=not_maximum_value
> (in the middle of values), DBFBrowse does not sets cursor on just appended
> record. How can I avoid this? I always want to set cursor onto just
> appended
> record.
>
> Can you look at this? Just click 'Append' button, enter 120 into first
> field, anything into second and press Enter.
>
> Regards, Oleg.
>
>
>
>
>
>
DBFBrowse nRecSel after Append
Ignacio!
> Just do the following:
>
> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
> lCanceled := .t.
> RETURN Nil
>
> This way you are telling the class to do nothing after your manual append
> operation.
Sorry, but it does not work in my sample.
After appending record with field->nomerpr:=not_maximum_value
(in the middle of values), DBFBrowse does not sets cursor on just appended
record. You can see it in my sample, if you click 'Append' button, then
enter 120 into first
field, anything into second field and press Enter.
Regards, Oleg.
> Just do the following:
>
> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
> lCanceled := .t.
> RETURN Nil
>
> This way you are telling the class to do nothing after your manual append
> operation.
Sorry, but it does not work in my sample.
After appending record with field->nomerpr:=not_maximum_value
(in the middle of values), DBFBrowse does not sets cursor on just appended
record. You can see it in my sample, if you click 'Append' button, then
enter 120 into first
field, anything into second field and press Enter.
Regards, Oleg.
DBFBrowse nRecSel after Append
Ignacio!
> Just do the following:
>
> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
> lCanceled := .t.
> RETURN Nil
>
> This way you are telling the class to do nothing after your manual append
> operation.
Sorry, but it does not work in my sample.
After appending record with field->nomerpr:=not_maximum_value
(in the middle of values), DBFBrowse does not sets cursor on just appended
record. You can see it in my sample, if you click 'Append' button, then
enter 120 into first
field, anything into second field and press Enter.
Regards, Oleg.
> Just do the following:
>
> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
> lCanceled := .t.
> RETURN Nil
>
> This way you are telling the class to do nothing after your manual append
> operation.
Sorry, but it does not work in my sample.
After appending record with field->nomerpr:=not_maximum_value
(in the middle of values), DBFBrowse does not sets cursor on just appended
record. You can see it in my sample, if you click 'Append' button, then
enter 120 into first
field, anything into second field and press Enter.
Regards, Oleg.
DBFBrowse nRecSel after Append
Ignacio!
I have found that all is working as I expect if i add the following code:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
if oSender:nEditMode==beAppend
skip -1
endif
// lCanceled:=.t.
RETURN Nil
But I think it is a hack, and I am not sure that it will be working in all
cases.
Can you analyze and tell me if described behaviour is a bug or not?
Regards, Oleg.
I have found that all is working as I expect if i add the following code:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
if oSender:nEditMode==beAppend
skip -1
endif
// lCanceled:=.t.
RETURN Nil
But I think it is a hack, and I am not sure that it will be working in all
cases.
Can you analyze and tell me if described behaviour is a bug or not?
Regards, Oleg.
DBFBrowse nRecSel after Append
Ignacio!
I have found that all is working as I expect if i add the following code:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
if oSender:nEditMode==beAppend
skip -1
endif
// lCanceled:=.t.
RETURN Nil
But I think it is a hack, and I am not sure that it will be working in all
cases.
Can you analyze and tell me if described behaviour is a bug or not?
Regards, Oleg.
I have found that all is working as I expect if i add the following code:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
if oSender:nEditMode==beAppend
skip -1
endif
// lCanceled:=.t.
RETURN Nil
But I think it is a hack, and I am not sure that it will be working in all
cases.
Can you analyze and tell me if described behaviour is a bug or not?
Regards, Oleg.
DBFBrowse nRecSel after Append
Ignacio!
I have found that all is working as I expect if i add the following code:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
if oSender:nEditMode==beAppend
skip -1
endif
// lCanceled:=.t.
RETURN Nil
But I think it is a hack (or workaround), and I am not sure that it will be
working in all
cases. Can you analyze and tell me if described behaviour is a bug or not?
Regards, Oleg.
I have found that all is working as I expect if i add the following code:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
if oSender:nEditMode==beAppend
skip -1
endif
// lCanceled:=.t.
RETURN Nil
But I think it is a hack (or workaround), and I am not sure that it will be
working in all
cases. Can you analyze and tell me if described behaviour is a bug or not?
Regards, Oleg.
DBFBrowse nRecSel after Append
Ignacio!
I have found that all is working as I expect if i add the following code:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
if oSender:nEditMode==beAppend
skip -1
endif
// lCanceled:=.t.
RETURN Nil
But I think it is a hack (or workaround), and I am not sure that it will be
working in all
cases. Can you analyze and tell me if described behaviour is a bug or not?
Regards, Oleg.
I have found that all is working as I expect if i add the following code:
METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
if oSender:nEditMode==beAppend
skip -1
endif
// lCanceled:=.t.
RETURN Nil
But I think it is a hack (or workaround), and I am not sure that it will be
working in all
cases. Can you analyze and tell me if described behaviour is a bug or not?
Regards, Oleg.
- ignacio
- Site Admin
- Mensajes: 9469
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
DBFBrowse nRecSel after Append
Oleg,
Here is working fine. Pleae try the attached project.
Regards
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465b2aec@ozsrv2.ozlan.local...]465b2aec@ozsrv2.ozlan.local...[/email]
> Ignacio!
>
>> Just do the following:
>>
>> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
>> lCanceled := .t.
>> RETURN Nil
>>
>> This way you are telling the class to do nothing after your manual append
>> operation.
>
> Sorry, but it does not work in my sample.
> After appending record with field->nomerpr:=not_maximum_value
> (in the middle of values), DBFBrowse does not sets cursor on just appended
> record. You can see it in my sample, if you click 'Append' button, then
> enter 120 into first
> field, anything into second field and press Enter.
>
> Regards, Oleg.
>
>
Attached files test25.zip (1.9 KB)Â
Here is working fine. Pleae try the attached project.
Regards
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465b2aec@ozsrv2.ozlan.local...]465b2aec@ozsrv2.ozlan.local...[/email]
> Ignacio!
>
>> Just do the following:
>>
>> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
>> lCanceled := .t.
>> RETURN Nil
>>
>> This way you are telling the class to do nothing after your manual append
>> operation.
>
> Sorry, but it does not work in my sample.
> After appending record with field->nomerpr:=not_maximum_value
> (in the middle of values), DBFBrowse does not sets cursor on just appended
> record. You can see it in my sample, if you click 'Append' button, then
> enter 120 into first
> field, anything into second field and press Enter.
>
> Regards, Oleg.
>
>
Attached files test25.zip (1.9 KB)Â
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
DBFBrowse nRecSel after Append
Oleg,
Here is working fine. Pleae try the attached project.
Regards
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465b2aec@ozsrv2.ozlan.local...]465b2aec@ozsrv2.ozlan.local...[/email]
> Ignacio!
>
>> Just do the following:
>>
>> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
>> lCanceled := .t.
>> RETURN Nil
>>
>> This way you are telling the class to do nothing after your manual append
>> operation.
>
> Sorry, but it does not work in my sample.
> After appending record with field->nomerpr:=not_maximum_value
> (in the middle of values), DBFBrowse does not sets cursor on just appended
> record. You can see it in my sample, if you click 'Append' button, then
> enter 120 into first
> field, anything into second field and press Enter.
>
> Regards, Oleg.
>
>
Attached files test25.zip (1.9 KB)Â
Here is working fine. Pleae try the attached project.
Regards
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465b2aec@ozsrv2.ozlan.local...]465b2aec@ozsrv2.ozlan.local...[/email]
> Ignacio!
>
>> Just do the following:
>>
>> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
>> lCanceled := .t.
>> RETURN Nil
>>
>> This way you are telling the class to do nothing after your manual append
>> operation.
>
> Sorry, but it does not work in my sample.
> After appending record with field->nomerpr:=not_maximum_value
> (in the middle of values), DBFBrowse does not sets cursor on just appended
> record. You can see it in my sample, if you click 'Append' button, then
> enter 120 into first
> field, anything into second field and press Enter.
>
> Regards, Oleg.
>
>
Attached files test25.zip (1.9 KB)Â
- ignacio
- Site Admin
- Mensajes: 9469
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
DBFBrowse nRecSel after Append
Oleg,
Try to overload temporarily the method TDbfBrowse:CancelEdit() with the
following code:
CLASS TDbfBrowse FROM XDbfBrowse
METHOD CancelEdit( lAbort, nKey )
END CLASS
METHOD CancelEdit( lAbort, nKey ) CLASS TDbfBrowse
LOCAL oCol
LOCAL nEditMode := ::nEditMode
IF ! ::lEditMode
RETURN Nil
ENDIF
Super:CancelEdit( @lAbort, nKey, .F. )
IF ! lAbort .AND. ::lAutoSave
IF nEditMode >= beAPPEND
( ::cAlias )->( DbAppend() )
IF NetErr()
lAbort := .T.
ENDIF
ELSE
lAbort := !( ::cAlias )->( DbRLock() )
ENDIF
ENDIF
FOR EACH oCol IN ::aCols
WITH OBJECT oCol
IF :lEdited
IF !lAbort .AND. ::lAutoSave
( ::cAlias )->( FieldPut( :nField, :oGridEdit:Value ) )
ENDIF
:lEdited := .F.
ENDIF
END WITH
NEXT
IF ! lAbort .AND. ::lAutoSave
( ::cAlias )->( DbrUnlock() )
ENDIF
IF nEditMode = beAPPEND .AND. !lAbort
::nRowSel++
::nLen++
::OnChange( .T. )
ENDIF
::Redraw()
RETURN Nil
If it works correctly on your side we will include it on next release. Thank
you for your feedback and sorry for any inconvenience.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465bb8f7@ozsrv2.ozlan.local...]465bb8f7@ozsrv2.ozlan.local...[/email]
> Ignacio!
>
> I have found that all is working as I expect if i add the following code:
>
> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
> if oSender:nEditMode==beAppend
> skip -1
> endif
> // lCanceled:=.t.
> RETURN Nil
>
> But I think it is a hack, and I am not sure that it will be working in all
> cases.
> Can you analyze and tell me if described behaviour is a bug or not?
>
> Regards, Oleg.
>
>
Try to overload temporarily the method TDbfBrowse:CancelEdit() with the
following code:
CLASS TDbfBrowse FROM XDbfBrowse
METHOD CancelEdit( lAbort, nKey )
END CLASS
METHOD CancelEdit( lAbort, nKey ) CLASS TDbfBrowse
LOCAL oCol
LOCAL nEditMode := ::nEditMode
IF ! ::lEditMode
RETURN Nil
ENDIF
Super:CancelEdit( @lAbort, nKey, .F. )
IF ! lAbort .AND. ::lAutoSave
IF nEditMode >= beAPPEND
( ::cAlias )->( DbAppend() )
IF NetErr()
lAbort := .T.
ENDIF
ELSE
lAbort := !( ::cAlias )->( DbRLock() )
ENDIF
ENDIF
FOR EACH oCol IN ::aCols
WITH OBJECT oCol
IF :lEdited
IF !lAbort .AND. ::lAutoSave
( ::cAlias )->( FieldPut( :nField, :oGridEdit:Value ) )
ENDIF
:lEdited := .F.
ENDIF
END WITH
NEXT
IF ! lAbort .AND. ::lAutoSave
( ::cAlias )->( DbrUnlock() )
ENDIF
IF nEditMode = beAPPEND .AND. !lAbort
::nRowSel++
::nLen++
::OnChange( .T. )
ENDIF
::Redraw()
RETURN Nil
If it works correctly on your side we will include it on next release. Thank
you for your feedback and sorry for any inconvenience.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465bb8f7@ozsrv2.ozlan.local...]465bb8f7@ozsrv2.ozlan.local...[/email]
> Ignacio!
>
> I have found that all is working as I expect if i add the following code:
>
> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
> if oSender:nEditMode==beAppend
> skip -1
> endif
> // lCanceled:=.t.
> RETURN Nil
>
> But I think it is a hack, and I am not sure that it will be working in all
> cases.
> Can you analyze and tell me if described behaviour is a bug or not?
>
> Regards, Oleg.
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
DBFBrowse nRecSel after Append
Oleg,
Try to overload temporarily the method TDbfBrowse:CancelEdit() with the
following code:
CLASS TDbfBrowse FROM XDbfBrowse
METHOD CancelEdit( lAbort, nKey )
END CLASS
METHOD CancelEdit( lAbort, nKey ) CLASS TDbfBrowse
LOCAL oCol
LOCAL nEditMode := ::nEditMode
IF ! ::lEditMode
RETURN Nil
ENDIF
Super:CancelEdit( @lAbort, nKey, .F. )
IF ! lAbort .AND. ::lAutoSave
IF nEditMode >= beAPPEND
( ::cAlias )->( DbAppend() )
IF NetErr()
lAbort := .T.
ENDIF
ELSE
lAbort := !( ::cAlias )->( DbRLock() )
ENDIF
ENDIF
FOR EACH oCol IN ::aCols
WITH OBJECT oCol
IF :lEdited
IF !lAbort .AND. ::lAutoSave
( ::cAlias )->( FieldPut( :nField, :oGridEdit:Value ) )
ENDIF
:lEdited := .F.
ENDIF
END WITH
NEXT
IF ! lAbort .AND. ::lAutoSave
( ::cAlias )->( DbrUnlock() )
ENDIF
IF nEditMode = beAPPEND .AND. !lAbort
::nRowSel++
::nLen++
::OnChange( .T. )
ENDIF
::Redraw()
RETURN Nil
If it works correctly on your side we will include it on next release. Thank
you for your feedback and sorry for any inconvenience.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465bb8f7@ozsrv2.ozlan.local...]465bb8f7@ozsrv2.ozlan.local...[/email]
> Ignacio!
>
> I have found that all is working as I expect if i add the following code:
>
> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
> if oSender:nEditMode==beAppend
> skip -1
> endif
> // lCanceled:=.t.
> RETURN Nil
>
> But I think it is a hack, and I am not sure that it will be working in all
> cases.
> Can you analyze and tell me if described behaviour is a bug or not?
>
> Regards, Oleg.
>
>
Try to overload temporarily the method TDbfBrowse:CancelEdit() with the
following code:
CLASS TDbfBrowse FROM XDbfBrowse
METHOD CancelEdit( lAbort, nKey )
END CLASS
METHOD CancelEdit( lAbort, nKey ) CLASS TDbfBrowse
LOCAL oCol
LOCAL nEditMode := ::nEditMode
IF ! ::lEditMode
RETURN Nil
ENDIF
Super:CancelEdit( @lAbort, nKey, .F. )
IF ! lAbort .AND. ::lAutoSave
IF nEditMode >= beAPPEND
( ::cAlias )->( DbAppend() )
IF NetErr()
lAbort := .T.
ENDIF
ELSE
lAbort := !( ::cAlias )->( DbRLock() )
ENDIF
ENDIF
FOR EACH oCol IN ::aCols
WITH OBJECT oCol
IF :lEdited
IF !lAbort .AND. ::lAutoSave
( ::cAlias )->( FieldPut( :nField, :oGridEdit:Value ) )
ENDIF
:lEdited := .F.
ENDIF
END WITH
NEXT
IF ! lAbort .AND. ::lAutoSave
( ::cAlias )->( DbrUnlock() )
ENDIF
IF nEditMode = beAPPEND .AND. !lAbort
::nRowSel++
::nLen++
::OnChange( .T. )
ENDIF
::Redraw()
RETURN Nil
If it works correctly on your side we will include it on next release. Thank
you for your feedback and sorry for any inconvenience.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Oleg" <info@cluster.samara.ru> escribió en el mensaje
news:[email=465bb8f7@ozsrv2.ozlan.local...]465bb8f7@ozsrv2.ozlan.local...[/email]
> Ignacio!
>
> I have found that all is working as I expect if i add the following code:
>
> METHOD DbfBrowse1PostEdit( oSender, lCanceled, nKey ) CLASS TForm1
> if oSender:nEditMode==beAppend
> skip -1
> endif
> // lCanceled:=.t.
> RETURN Nil
>
> But I think it is a hack, and I am not sure that it will be working in all
> cases.
> Can you analyze and tell me if described behaviour is a bug or not?
>
> Regards, Oleg.
>
>
DBFBrowse nRecSel after Append
Ignacio!
Thank you for your support.
I analyzed all my attempts and your proposals. My previous solution with
"Skip -1" was incomplete. The problem happens when I add some record and by
index order it must get into the middle of first DBFBrowse's screen. In this
case the current record is changing as the result of incorrect TDBFBrowse's
stabilization. You can see it if you debug TDBFBrowse:CancelEdit (appended
record must have small values in the first field - 4,5,6...).
Anyway, I was able to workaround this behaviour in attached sample. I do not
like it, but it works. Maybe you analyze it and suggest something better.
Sorry for not clear explanation, the English is not my native language.
Regards, Oleg
Attached files test25.zip (3.2 KB)Â
Thank you for your support.
I analyzed all my attempts and your proposals. My previous solution with
"Skip -1" was incomplete. The problem happens when I add some record and by
index order it must get into the middle of first DBFBrowse's screen. In this
case the current record is changing as the result of incorrect TDBFBrowse's
stabilization. You can see it if you debug TDBFBrowse:CancelEdit (appended
record must have small values in the first field - 4,5,6...).
Anyway, I was able to workaround this behaviour in attached sample. I do not
like it, but it works. Maybe you analyze it and suggest something better.
Sorry for not clear explanation, the English is not my native language.
Regards, Oleg
Attached files test25.zip (3.2 KB)Â
DBFBrowse nRecSel after Append
Ignacio!
Thank you for your support.
I analyzed all my attempts and your proposals. My previous solution with
"Skip -1" was incomplete. The problem happens when I add some record and by
index order it must get into the middle of first DBFBrowse's screen. In this
case the current record is changing as the result of incorrect TDBFBrowse's
stabilization. You can see it if you debug TDBFBrowse:CancelEdit (appended
record must have small values in the first field - 4,5,6...).
Anyway, I was able to workaround this behaviour in attached sample. I do not
like it, but it works. Maybe you analyze it and suggest something better.
Sorry for not clear explanation, the English is not my native language.
Regards, Oleg
Attached files test25.zip (3.2 KB)Â
Thank you for your support.
I analyzed all my attempts and your proposals. My previous solution with
"Skip -1" was incomplete. The problem happens when I add some record and by
index order it must get into the middle of first DBFBrowse's screen. In this
case the current record is changing as the result of incorrect TDBFBrowse's
stabilization. You can see it if you debug TDBFBrowse:CancelEdit (appended
record must have small values in the first field - 4,5,6...).
Anyway, I was able to workaround this behaviour in attached sample. I do not
like it, but it works. Maybe you analyze it and suggest something better.
Sorry for not clear explanation, the English is not my native language.
Regards, Oleg
Attached files test25.zip (3.2 KB)Â