microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
732 stars 243 forks source link

Control visibility on navigate pages is not consistently updated accross groups #6060

Closed nicolassaleron closed 4 years ago

nicolassaleron commented 4 years ago

Describe the bug In Navigate pages, if the visibility of a group is controlled with a variable, the visibility is only refreshed when the variable value is changed on the displayed tab. If the group is currently hidden (because you are on another tab), when the tab where the group is placed is displayed by the user the visibility might be incorrect.

To Reproduce Steps and to reproduce the behavior:

  1. Create a project with the page below
  2. Run it and play with the IsChecked checkbox.
page 80000 "DRCVG TEST"
{
    PageType = NavigatePage;
    UsageCategory = Tasks;
    ApplicationArea = All;
    Caption = 'TEST';

    layout
    {
        area(Content)
        {
            group(General)
            {
                Caption = 'General';
                field(IsCheckedControl; IsChecked)
                {
                    ApplicationArea = All;
                    Caption = 'IsChecked';

                    trigger OnValidate()
                    begin
                        UpdateControls();
                    end;
                }
            }
            group(Other)
            {
                Caption = 'Other';
                field(IsCheckedControl2; IsChecked)
                {
                    ApplicationArea = All;
                    Caption = 'IsChecked';

                    trigger OnValidate()
                    begin
                        UpdateControls();
                    end;
                }
                group(AVisibleGroup)
                {
                    Caption = 'AVisible';
                    ShowCaption = false;
                    Visible = AVisible;
                    InstructionalText = 'AVisible';
                }
                group(BVisibleGroup)
                {
                    Caption = 'BVisible';
                    ShowCaption = false;
                    Visible = BVisible;
                    InstructionalText = 'BVisible';
                }
            }
        }
    }

    trigger OnOpenPage()
    begin
        UpdateControls();
    end;

    local procedure UpdateControls()
    begin
        AVisible := IsChecked;
        BVisible := not IsChecked;
    end;

    var
        [InDataSet]
        IsChecked, AVisible, BVisible : Boolean;
}

Expected behavior When the page is loaded BVisibleGroup should be visible and AVisibleGroup should be hidden (because IsChecked is false). When IsChecked is changed on the first tab, the visibility of AVisibleGroup and BVisibleGroup should be consistant when they are displayed again.

Screenshots Image

5. Versions:

atoader commented 4 years ago

Hi! Please take a minute to read the guidelines for this repository https://github.com/microsoft/AL and our collection of frequently asked questions https://github.com/Microsoft/AL/wiki/frequently-Asked-Questions .

As this repository is only for issues related to the AL compiler in latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.

To open a support case, you can:

If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.