Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LC0016 with SplitButton and Repeater Scope #587

Closed
jwikman opened this issue Apr 10, 2024 · 4 comments · Fixed by #615
Closed

LC0016 with SplitButton and Repeater Scope #587

jwikman opened this issue Apr 10, 2024 · 4 comments · Fixed by #615
Labels
bug Something isn't working Resolved

Comments

@jwikman
Copy link
Contributor

jwikman commented Apr 10, 2024

When having the ShowAs property on an Action Group set to SplitButton, the Caption property is not needed on the group. LC0016 handles this in a nice way.

But I just discovered that if an action inside a SplitButton Action Group has the Scope set to Repeater, the Caption is needed for the context menu on the line, otherwise an autogenerated caption i displayed in the context menu (in my example, the actions are promoted, hence the Category_ prefixes):

image

So, to my suggestion:
Add a new condition for LC0016, to require Caption on Page Action Group if they have SplitButton specified and the action Scope is set to Repeater. (Note that this should apply both to action groups in the promoted action area, as on regular action groups)

@jwikman
Copy link
Contributor Author

jwikman commented Apr 10, 2024

An update to this:
I just noticed that this ONLY applies to Promoted Action Groups.

Repro code:

page 50100 PageName
{
    Caption = 'PageCaption';
    Editable = false;
    PageType = List;
    ApplicationArea = All;
    UsageCategory = Lists;
    SourceTable = Customer;

    layout
    {
        area(Content)
        {
            repeater(GroupName)
            {
                field(Name; Rec.Name)
                {
                }
            }
        }
    }

    actions
    {
        area(Processing)
        {
            group(RegularGroup)
            {
                ShowAs = SplitButton;
                action(ActionName)
                {
                    Caption = 'ActionCaption';
                    ApplicationArea = All;

                    trigger OnAction()
                    begin
                        Message('Hello World');
                    end;
                }
                action(ActionName2)
                {
                    Caption = 'Action2Caption';
                    ApplicationArea = All;
                    Scope = Repeater;

                    trigger OnAction()
                    begin
                        Message('Hello World');
                    end;
                }
                action(PromotedActionName2)
                {
                    Caption = 'PromotedAction2Caption';
                    ApplicationArea = All;
                    Scope = Repeater;

                    trigger OnAction()
                    begin
                        Message('Hello World');
                    end;
                }
            }
            group(SecondGroup)
            {
                ShowAs = SplitButton;
                action(SecondActionName)
                {
                    Caption = 'SecondActionCaption';
                    ApplicationArea = All;

                    trigger OnAction()
                    begin
                        Message('Hello World');
                    end;
                }
                action(SecondActionName2)
                {
                    Caption = 'SecondAction2Caption';
                    ApplicationArea = All;
                    Scope = Repeater;

                    trigger OnAction()
                    begin
                        Message('Hello World');
                    end;
                }
            }
        }
        area(Promoted)
        {
            group(Category_DEMO)
            {
                ShowAs = SplitButton;

                actionref(PromotedActionName2_Promoted; PromotedActionName2)
                {
                }
            }
        }
    }
}

The only thing disturbing me here is the auto generated caption for the promoted action group:
image

@Arthurvdv Arthurvdv added the bug Something isn't working label Apr 13, 2024
@Arthurvdv Arthurvdv linked a pull request May 18, 2024 that will close this issue
@Arthurvdv
Copy link
Collaborator

Thank you @jwikman for the detailed description and example, this was of great help!

This should now be resolved in the (pre)release version of v0.30.20 of the LinterCop.

@jwikman
Copy link
Contributor Author

jwikman commented May 18, 2024

Thanks @Arthurvdv!

@Arthurvdv
Copy link
Collaborator

Version v0.30.20 of the LinterCop is now released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants