Subject | Re: IB_ActionUpdate.pas |
---|---|
Author | Sergey Kanovka |
Post date | 2001-05-11T19:42:37Z |
--- In IBObjects@y..., "Serge" <sergey.kanovka@s...> wrote:
procedure TIB_ActionPost.ExecuteTarget(Target: TObject);
begin
// if Assigned(DataSource) then
// with DataSource do
// begin
// if Assigned(Dataset) then
// with Dataset do
// if NeedToPost then
// Post;
// end;
if Assigned( DataSource ) and Assigned( DataSource.Dataset )
then DataSource.Dataset.Post;
end;
procedure TIB_ActionCancel.ExecuteTarget(Target: TObject);
begin
// if Assigned(DataSource) then
// with DataSource do
// begin
// if Assigned(Dataset) then
// with Dataset do
// if NeedToPost then
// Cancel;
// end;
if Assigned( DataSource ) and Assigned( DataSource.Dataset )
then with DataSource.Dataset do
if State = dssSearch then
begin
ClearSearch;
Open;
end else Cancel;
end;
--
Serge
> I found errors in TIB_ActionPost.StateChanged and TIB_ActionCancel.StateChanged that prevent Enabled property from changing properly:Some more things. TIB_ActionPost and TIB_ActionCancel do not work when dataset is in dssSearch mode. Suggested changes:
>
> Instead of
>
> Enabled := Assigned( ADataSource ) and
> Assigned( ADataSource.DataSet ) and
> ( ADataSource.Dataset.NeedToPost ) and
> ( ADataSource.Dataset.State = dssSearch );
>
> is should probably be
>
> Enabled := Assigned( ADataSource ) and
> Assigned( ADataSource.DataSet ) and
> ( ( ADataSource.Dataset.NeedToPost ) or
> ( ADataSource.Dataset.State = dssSearch ) );
>
> --
> Serge
procedure TIB_ActionPost.ExecuteTarget(Target: TObject);
begin
// if Assigned(DataSource) then
// with DataSource do
// begin
// if Assigned(Dataset) then
// with Dataset do
// if NeedToPost then
// Post;
// end;
if Assigned( DataSource ) and Assigned( DataSource.Dataset )
then DataSource.Dataset.Post;
end;
procedure TIB_ActionCancel.ExecuteTarget(Target: TObject);
begin
// if Assigned(DataSource) then
// with DataSource do
// begin
// if Assigned(Dataset) then
// with Dataset do
// if NeedToPost then
// Cancel;
// end;
if Assigned( DataSource ) and Assigned( DataSource.Dataset )
then with DataSource.Dataset do
if State = dssSearch then
begin
ClearSearch;
Open;
end else Cancel;
end;
--
Serge