FileDialog - OnDialogClosed not called anymore

dominggus
2024-12-18
2025-04-25
  • dominggus - 2024-12-18

    Hi, since the latest update it seems the OnDialogClosed is not called anymore??

    using CODESYS SP20 Patch 3 with CODESYS Visualization 4.6.0.0

    I am using LoadWriteRecipe to load a recipe file from disk (with some custom dialog settings), and I need to run a function (Recipes_LoadFromRecipeData()) afterwards which I execute when OnDialogClosed is closed with OK button.

    See attached screenshot and code below:

    ***
    OnDialogClosed : Recipes_OnLoadFileDialogClosed(pClientData):
    ***
    // the DialogManager is provided via the implicitly available VisuManager
    dialogMan :=  VisuElems.g_VisuManager.GetDialogManager();      
    IF dialogMan <> 0 AND pClientData <> 0 THEN
        FileOpenCloseDialog := dialogMan.GetDialog('VisuDialogs.FileOpenSave'); // gets the FileOpenSave dialog
        IF FileOpenCloseDialog <> 0 THEN
            result := FileOpenCloseDialog.GetResult(); // gets the result (OK, Cancel) of the dialog
            IF result = VisuElems.Visu_DialogResult.OK THEN
                Recipes_LoadFromRecipeData();
            END_IF
        END_IF
    END_IF
    
    ***
    OnMouseClick: Execute ST-Code
    ***
    // override FileOpenSave Dialog settings
    // Visu_FbFileListProvider.Initialize(stDirectory, stFilter, stFileIn, stTitle, iRowCount, bBrowseDirectory, bTouch) 
    VisuDialogs.g_FileListProvider.Initialize('./', '*.bunkerrecipe', '', 'Load recipe', 20, TRUE, FALSE);
    VisuDialogs.g_FileListProvider();
    

    This used to work in CODESYS v3.5 SP20 Patch 1, but it seems it doesn't work anymore unfortunately?

    The OnDialogClosed just never seems to be called anymore....

     

    Last edit: dominggus 2024-12-18
  • dominggus - 2024-12-18

    updated to CODESYS Visualization 4.7.0.0, still not working...

     
  • manuknecht - 2025-04-25

    I had similar issues with the OnDialogClosed not being called. I realized that this behaviour is resolved, when the according visualization object on which the input configuration is set is moved to the foreground. Somehow, the object has to be one of the lowest elements in the Element List (i.e. in the foreground) for it to work.

     

Log in to post a comment.