Subject RE: [IBO] bookmark problem after insert
Author
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 then
    Result := Result + 1;

  // restore edit/insert states
  case OldState of
  dsEdit: d.Edit;
  dsInsert: d.Insert;
  end;

  //prevent memory leak
  d.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);
begin
    Handled := False;

    if NavButton = nbInsert then
    begin
        IBOQuery.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.