View Issue Details

IDProjectCategoryView StatusLast Update
0003890JEDI VCL00 JVCL Componentspublic2007-12-16 11:44
ReportermooreAssigned ToAHUser 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.34 
Summary0003890: JvDBRichEdit puts Dataset in edit mode
Descriptionjust put a dataset and a datasource and link a JvDBRichEdit, open the dataset on form load and it will be open in edit mode without making any edit/insert operation,
make the JvDBRichEdit Datasource property to nil and the dataset opens normally, that is, browse mode..
TagsNo tags attached.

Activities

obones

2006-09-09 08:59

administrator   ~0010088

Please provide the zipped sources of a sample application that shows this behaviour.

2006-09-09 09:35

 

Richdit.zip (1,484 bytes)

moore

2006-09-09 09:36

reporter   ~0010089

Simple example source included..

obones

2006-10-06 03:33

administrator   ~0010308

It's because of the TJvDBRichEdit.EMSetCharFormat function that calls EditCanModify. What do you suggest we do?

ultimo

2006-11-03 08:07

reporter   ~0010409

On creating component call EMSetCharFormat, this procedure call EditCanModify and this procedure Check if DataLink is in EditMode, if not then FDataLink.Edit.
I correct this to check if datasource autoedit is true, and EMSetCharFormat procedure post change (see below)

procedure TJvDBRichEdit.EMSetCharFormat(var Msg: TMessage);
begin
  if FMemoLoaded then
    if not FUpdating then
        if EditCanModify then
        begin
          Change;
          if (FDataLink.Editing) then //<----- Added
            FDataLink.DataSet.Post; //<----- Added
        end;
  inherited;
end;


function TJvDBRichEdit.EditCanModify: Boolean;
begin
  FStateChanging := True;
  try
    Result := FDataLink.Editing;
    if not Result and Assigned(FDataLink.Field) then
    try
      if FDataLink.Field.IsBlob then
        FDataSave := FDataLink.Field.AsString;
      Result := FDataLink.DataSource.AutoEdit and FDataLink.Edit;
    finally
      FDataSave := '';
    end;
  finally
    FStateChanging := False;
  end;
end;

moore

2007-01-18 02:42

reporter   ~0010565

I think it's better to replace this :

FDataLink.DataSet.Post; //<----- Added

with this :

FDataLink.DataSet.CheckBrowseMode;

ZENsan

2007-02-03 02:58

reporter   ~0010697

That it puts in Edit mode - it is half a problem. But if you will change this method with Post - then probl;ems will be more then before. Have thought about aftereffects?

obones

2007-06-19 07:04

administrator   ~0013437

Anyone care to propose a non breaking solution?

obones

2007-10-12 04:21

administrator   ~0013898

Hello ?

AHUser

2007-12-16 11:44

developer   ~0014063

Fixed in SVN

Issue History

Date Modified Username Field Change
2006-09-09 06:40 moore New Issue
2006-09-09 08:59 obones Note Added: 0010088
2006-09-09 08:59 obones Status new => feedback
2006-09-09 09:35 moore File Added: Richdit.zip
2006-09-09 09:36 moore Note Added: 0010089
2006-10-06 03:33 obones Note Added: 0010308
2006-11-03 08:07 ultimo Note Added: 0010409
2007-01-18 02:42 moore Note Added: 0010565
2007-02-03 02:58 ZENsan Note Added: 0010697
2007-06-19 07:04 obones Note Added: 0013437
2007-10-12 04:21 obones Note Added: 0013898
2007-12-16 11:44 AHUser Status feedback => resolved
2007-12-16 11:44 AHUser Fixed in Version => Daily / SVN
2007-12-16 11:44 AHUser Resolution open => fixed
2007-12-16 11:44 AHUser Assigned To => AHUser
2007-12-16 11:44 AHUser Note Added: 0014063