Subject Re: [IBO] Re: cache sync - before edit
Author Harald Klomann
This was just a suggestion, not the best, I aggree ;-)
There is more than one way, here´s a sample code which
works for TIB_Edit fields with less implementation work.

Set the query´s bsBeforEdit to false.

procedure TForm1.IB_Query1BeforeEdit(IB_Dataset: TIB_Dataset);
begin
IB_Query1.InvalidateRowNum(IB_Query1.RowNum);
if ActiveControl is TIB_Edit then begin
(ActiveControl AS TIB_Edit).Text :=
IB_Query1.FieldByName((ActiveControl AS TIB_Edit).DataField).Value;
end;
end;

Your thought after solution deeper in IBO you wont find, as long as you
can´t tell us how IBO should proceed in situations which Marco described:

With autoedit ON:
b1) the user clicks to the checkbox to make it "checked"
b2) what shold the buffer update do? Get the updated data from the
server, then process the user input? Or force the user input as the
right data? But what happens if you change the day of a date that
someone else has changed before, changing the month?

And other thoughts:
What should happen with the key the user entered ?
Put it at the beginning or end of the edit field ?
What is your opinion ?

Harald





pi3k14 schrieb:
>
> Because it wasn't a particular good solution; I have several forms,
> with lot of fields and queries.
>
> And such "hacks" into them would give me a maintenance nightmare (can
> never be sure that every developer remembers this kludge).
>
> I need a solution deeper down in the IB objects machinery.
>
> But, by all means, thanx for the suggestion.
>
> --- In IBObjects@y..., Harald Klomann <nibler@t...> wrote:
> > I think I supplied you with some sample code to fix your problem.
> > Why dont you just use it ?
> >
> > Harald
> >
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/