Subject | RE: [IBO] bookmark problem after insert |
---|---|
Author | |
Post date | 2015-08-01T08:56:29Z |
Hi Jason,
I search why it's working before.
What your are saying is correct :-)
GotoBookmark() calls CheckBrowseMode which cancels or posts the current record.
I found the function TTIWCustomDBAdvWebGrid.RecNo() in the TMS GRID component which makes the boomark get/goto actions.
Part of its code :
d.GotoBookmark(bk);if OldState = dsInsert thenResult := Result + 1;// restore edit/insert statescase OldState ofdsEdit: d.Edit;dsInsert: d.Insert;end;//prevent memory leakd.FreeBookmark(bk);You can see that the previous dataset state is restored after the GotoBookMark !I compared with previous versions and the function is the same.Now GotoBookmark raises an exception and I didn't see it before.To solve the problem, I do an Append instead of the default Insert :procedure TIWForm_MID_Base.IWDBNavigatorBeforeAction(Sender: TObject;NavButton: TNavigateBtn; var Handled: Boolean);beginHandled := False;if NavButton = nbInsert thenbeginIBOQuery.Append;Handled := true;end;end;I don't see the exception anymore... and for me it's sufficient now but I can't verify source code of all the components I use (and I bought), I don't have the source code of all anyway...I need to know why it's work before : for me the exception is new.Kind regards,L GILBERT.