Subject | R: [IBO] TIBO* V.4.2Ga - CacheDMLRefresh after InternalDataset bu ffer syncronization |
---|---|
Author | Enrico Raviglione |
Post date | 2002-03-06T05:11:02Z |
Hi Jason,
i have installed your 4.2Ga and i have try your Resync([]) solution.
For "ditInsert" and "ditDelete" case all seem to work fine but "ditEdit"
case have some refresh problem.
I attach here my C++ code, how you can see in "ditEdit" case i do only an
InvalidateBookmark() but when i do this my current record are changed and
the Grid display another section of the table (??).
void __fastcall TIsIBOTable::DefaultDMLCacheReceivedItem(TIB_Dataset
*ADataset, const TIB_DMLCacheItem *ADMLCacheItem)
{
//
// From: IBA_BDataset.IMP -->
TIB_BDataset.DefaultDMLCacheReceivedItem()
//
TIBOInternalDataset * IDataset = dynamic_cast<TIBOInternalDataset
*>(ADataset);
if ( IDataset )
{
int ii;
String tmpStr;
tmpStr = "";
for (ii = 0; ii <= IDataset->KeyFields->ColumnCount - 1; ii++ )
{
if ( ii > 0 )
tmpStr = tmpStr + ";";
tmpStr = tmpStr + IDataset->KeyFields->Columns[ii]->FieldName;
}
if ( AnsiCompareText(ADMLCacheItem->KeyFieldNames, tmpStr) == 0 )
{
IDataset->KeyFields->Values[ ADMLCacheItem->KeyFieldNames ] =
ADMLCacheItem->KeyFieldValues;
if ( State == dsEdit || State == dsInsert )
FFlagDMLRefreshPending = true;
if ( State == dsBrowse )
{
FFlagDMLRefreshPending = false;
TResyncMode syncMode;
syncMode.Clear();
switch ( ADMLCacheItem->DMLCacheItemType )
{
case ditEdit:
InvalidateBookmark(IDataset->KeyFields->RowData);
break;
case ditDelete:
{
IDataset->DeleteBufferBookmark(IDataset->KeyFields->RowData );
UpdateCursorPos();
Resync( syncMode );
}
break;
case ditInsert:
{
IDataset->InsertBufferBookmark(
IDataset->KeyFields->RowData );
UpdateCursorPos();
Resync( syncMode );
}
break;
}
}
}
}
}
//--------------------------------------------------------------------------
-
Best Regards,
Enrico Raviglione.
-----Messaggio originale-----
Da: Jason Wharton [mailto:jwharton@...]
Inviato: lunedi 25 febbraio 2002 20.12
A: IBObjects@yahoogroups.com
Oggetto: Re: [IBO] TIBO* "CacheDML - Refresh" after InternalDataset
buffer syncronization
Use the Resync([]) method to get it to resynchronize the tdataset bufferes
with the internal dataset buggers.
i have installed your 4.2Ga and i have try your Resync([]) solution.
For "ditInsert" and "ditDelete" case all seem to work fine but "ditEdit"
case have some refresh problem.
I attach here my C++ code, how you can see in "ditEdit" case i do only an
InvalidateBookmark() but when i do this my current record are changed and
the Grid display another section of the table (??).
void __fastcall TIsIBOTable::DefaultDMLCacheReceivedItem(TIB_Dataset
*ADataset, const TIB_DMLCacheItem *ADMLCacheItem)
{
//
// From: IBA_BDataset.IMP -->
TIB_BDataset.DefaultDMLCacheReceivedItem()
//
TIBOInternalDataset * IDataset = dynamic_cast<TIBOInternalDataset
*>(ADataset);
if ( IDataset )
{
int ii;
String tmpStr;
tmpStr = "";
for (ii = 0; ii <= IDataset->KeyFields->ColumnCount - 1; ii++ )
{
if ( ii > 0 )
tmpStr = tmpStr + ";";
tmpStr = tmpStr + IDataset->KeyFields->Columns[ii]->FieldName;
}
if ( AnsiCompareText(ADMLCacheItem->KeyFieldNames, tmpStr) == 0 )
{
IDataset->KeyFields->Values[ ADMLCacheItem->KeyFieldNames ] =
ADMLCacheItem->KeyFieldValues;
if ( State == dsEdit || State == dsInsert )
FFlagDMLRefreshPending = true;
if ( State == dsBrowse )
{
FFlagDMLRefreshPending = false;
TResyncMode syncMode;
syncMode.Clear();
switch ( ADMLCacheItem->DMLCacheItemType )
{
case ditEdit:
InvalidateBookmark(IDataset->KeyFields->RowData);
break;
case ditDelete:
{
IDataset->DeleteBufferBookmark(IDataset->KeyFields->RowData );
UpdateCursorPos();
Resync( syncMode );
}
break;
case ditInsert:
{
IDataset->InsertBufferBookmark(
IDataset->KeyFields->RowData );
UpdateCursorPos();
Resync( syncMode );
}
break;
}
}
}
}
}
//--------------------------------------------------------------------------
-
Best Regards,
Enrico Raviglione.
-----Messaggio originale-----
Da: Jason Wharton [mailto:jwharton@...]
Inviato: lunedi 25 febbraio 2002 20.12
A: IBObjects@yahoogroups.com
Oggetto: Re: [IBO] TIBO* "CacheDML - Refresh" after InternalDataset
buffer syncronization
Use the Resync([]) method to get it to resynchronize the tdataset bufferes
with the internal dataset buggers.
> Hi Jason,
> i must use TDataSet wrapper, i can't use your native components.
> Then i must find a solution with TDataSet wrapper.
> I can do a "controlled" refresh of the TDataset wrapper or this is
> impossible?
>
> Regards,
> Enrico Raviglione.
>
>