View Issue Details

IDProjectCategoryView StatusLast Update
0003342JEDI VCL00 JVCL Componentspublic2006-04-19 03:03
ReporterSeanBDurkinAssigned Toobones 
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.30 
Summary0003342: TJvBrowseForFolderAction action component incomplete and unworkable. Solution provided.
DescriptionWhen 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 InformationI 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);
FExecuteResult := False;
if not assigned( FDialog) then exit;

if assigned( FBeforeExecute) then
  FBeforeExecute( self);
FExecuteResult := FDialog.Execute;
if FExecuteResult then
    if assigned( FOnAccept) then
       FOnAccept( self)
    if assigned( FOnCancel) then
       FOnCancel( self);
if assigned( FDialog) then
  if assigned( FBeforeExecute) then
    FBeforeExecute( self);
if assigned( FAfterExecute) then
   FAfterExecute( self)
TagsNo tags attached.


related to 0005903 resolvedobones remove garbage from JvBaseDLG ? 



2006-04-05 05:38

administrator   ~0008964

In which file does this reside?
And could you post the zipped sources of a sample application?

2006-04-07 00:49 (4,348 bytes)


2006-04-07 00:55

reporter   ~0009010

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?


2006-04-13 08:55

administrator   ~0009094

Please use the modified files in 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.

2006-04-14 01:03 (42,155 bytes)


2006-04-14 01:04

administrator   ~0009100

I have updated the zip "fix" file, it now contains all the modified files required to compile a complete JVCL.


2006-04-17 17:12

reporter   ~0009128

Last edited: 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?

Sean B. Durkin


2006-04-19 03:03

administrator   ~0009139

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:
2006-04-07 00:55 SeanBDurkin Note Added: 0009010
2006-04-13 08:54 obones File Added:
2006-04-13 08:55 obones Note Added: 0009094
2006-04-14 01:03 obones File Deleted:
2006-04-14 01:03 obones File Added:
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