Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003342 [JEDI VCL] 00 JVCL Components major always 2005-12-05 19:18 2006-04-19 03:03
Reporter SeanBDurkin View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0003342: TJvBrowseForFolderAction action component incomplete and unworkable. Solution provided.
Description When TJvBrowseForFolderAction action is fired, the dialog execute result is
discarded, so there is no way for the user to test whether the user has pressed the Ok button or the Cancel button. Essentially, this makes the action component unusable.

Additional Information I suggest the following solution:
  (1) Publish the properties of OnAccept and OnCancel for the
        TJvCommonDialogFAction class (at least for the D6+ case);
  (2) Override the TJvCommonDialogFAction.ExecuteTarget method in
        a similar fashion to its ancestor TJvCommonDialogAction,
        except here you should reference the decendant version
        of the FDialog data member, not the ancestor version. See
        the code fragment below.

It is worth noting both units, JvDialogActns and JvBrowseFolder
are poorly implemented, and it may be better to rewrite both units
from scratch, rather that just apply this fix. A particularly telling
sign of poor design and/or implementation is the fact that
TJvCommonDialogFAction has two data members of the same name (FDialog).



procedure TJvCommonDialogFAction.ExecuteTarget( Target: TObject);
begin
{$IFDEF COMPILER6_UP}
FExecuteResult := False;
if not assigned( FDialog) then exit;

if assigned( FBeforeExecute) then
  FBeforeExecute( self);
FExecuteResult := FDialog.Execute;
if FExecuteResult then
    begin
    if assigned( FOnAccept) then
       FOnAccept( self)
    end
  else
    if assigned( FOnCancel) then
       FOnCancel( self);
{$ELSE}
if assigned( FDialog) then
  begin
  if assigned( FBeforeExecute) then
    FBeforeExecute( self);
  FDialog.Execute
  end;
{$ENDIF}
if assigned( FAfterExecute) then
   FAfterExecute( self)
end;
Tags No tags attached.
Attached Files zip file icon JvBrowseFolderAction.zip [^] (4,348 bytes) 2006-04-07 00:49
zip file icon 3342fix.zip [^] (42,155 bytes) 2006-04-14 01:03

- Relationships
related to 0005903resolvedobones remove garbage from JvBaseDLG ? 

-  Notes
(0008964)
obones (administrator)
2006-04-05 05:38

In which file does this reside?
And could you post the zipped sources of a sample application?
(0009010)
SeanBDurkin (reporter)
2006-04-07 00:55

1. In which file does this reside?
The TJvBrowseForFolderAction component is declared in the JvDialogActns unit.

2. And could you post the zipped sources of a sample application?
Done.
(0009094)
obones (administrator)
2006-04-13 08:55

Please use the modified files in 3342fix.zip in which I "simply" removed the FDialog declaration in the derived classes.
This looks better to me and seems to work. Please confirm it does as I'm waiting on your opinion to commit this in CVS.
(0009100)
obones (administrator)
2006-04-14 01:04

I have updated the zip "fix" file, it now contains all the modified files required to compile a complete JVCL.
(0009128)
SeanBDurkin (reporter)
2006-04-17 17:12
edited on: 2006-04-17 17:13

1. This is a good first step. It was a good idea to delete the extraneous
     FDialog data members. Also, I note that another good change that
     you made was to descend TJvCommonDialogPAction from TJvCommonDialogAction
     as opposed to TCustomAction, which was what is was before.
2. However, the core problem of procedure TJvCommonDialogFAction.ExecuteTarget
     discarding the result has not been addressed.
3. This can be resolved by:
    3.1 Deleting procedure TJvCommonDialogFAction.ExecuteTarget .
          The ancestor procedure TJvCommonDialogAction.ExecuteTarget does a
          perfectly good job of correct execution and handling of the result.
    3.2 Publishing properties OnAccept and OnCancel in TJvCommonDialogAction
4. I notice that TJvCommonDialogFAction and TJvCommonDialogPAction identical.
     I wonder if there is any value in having two identically declared classes?
     What does the "F" and the "P" in the class identifiers stand for?

Faithfully,
Sean B. Durkin

(0009139)
obones (administrator)
2006-04-19 03:03

Ok, this is now in SVN.
I have no answer to point 4, I left as is with a comment, mainly for historical reasons.

- Issue History
Date Modified Username Field Change
2005-12-05 19:18 SeanBDurkin New Issue
2006-02-09 10:12 outchy Status new => acknowledged
2006-04-05 05:38 obones Note Added: 0008964
2006-04-05 05:38 obones Status acknowledged => feedback
2006-04-07 00:49 SeanBDurkin File Added: JvBrowseFolderAction.zip
2006-04-07 00:55 SeanBDurkin Note Added: 0009010
2006-04-13 08:54 obones File Added: 3342fix.zip
2006-04-13 08:55 obones Note Added: 0009094
2006-04-14 01:03 obones File Deleted: 3342fix.zip
2006-04-14 01:03 obones File Added: 3342fix.zip
2006-04-14 01:04 obones Note Added: 0009100
2006-04-17 17:12 SeanBDurkin Note Added: 0009128
2006-04-17 17:13 SeanBDurkin Note Edited: 0009128
2006-04-19 03:03 obones Status feedback => resolved
2006-04-19 03:03 obones Resolution open => fixed
2006-04-19 03:03 obones Assigned To => obones
2006-04-19 03:03 obones Note Added: 0009139
2012-06-13 11:14 obones Relationship added related to 0005903


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker