View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003342||JEDI VCL||00 JVCL Components||public||2005-12-05 19:18||2006-04-19 03:03|
|Target Version||Fixed in Version||3.30|
|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);
FExecuteResult := False;
if not assigned( FDialog) then exit;
if assigned( FBeforeExecute) then
FExecuteResult := FDialog.Execute;
if FExecuteResult then
if assigned( FOnAccept) then
if assigned( FOnCancel) then
if assigned( FDialog) then
if assigned( FBeforeExecute) then
if assigned( FAfterExecute) then
|Tags||No tags attached.|
In which file does this reside?
And could you post the zipped sources of a sample application?
JvBrowseFolderAction.zip (4,348 bytes)
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?
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.
3342fix.zip (42,155 bytes)
||I have updated the zip "fix" file, it now contains all the modified files required to compile a complete JVCL.|
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
Ok, this is now in SVN.
I have no answer to point 4, I left as is with a comment, mainly for historical reasons.
|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|