Open Closed

Blazor toolbar not removing itself on navigation to edit page #8476


User avatar
0
joey73 created
  • ABP Framework version: v8.3.3
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Steps to reproduce the issue:

Hi,

We appear to be having an issue with toolbars not refreshing their state, or not removing themselves. Not really too sure, hence the support ticket.

We have a list page which works great and we have a new entity button which brings up the modal. We then do two different things, once the entity is complete we direct them to the edit page or we have an action added to the actions button in the grid to edit which will take you to a full page edit NOT a modal. When either of these happen the toolbar is left on the page, we end up having the title and the exportToExcel/NewEntity buttons. If we reload the page forcibly it works.

Any help on this would be appreciated

This is how we are setting the toolbar items on the list page:

        protected override async Task OnAfterRenderAsync(bool firstRender)
        {
            if (firstRender)
            {
                await SetBreadcrumbItemsAsync();
                await SetToolbarItemsAsync();
                await InvokeAsync(StateHasChanged);
            }
        }
        protected virtual ValueTask SetToolbarItemsAsync()
        {
            Toolbar.AddButton(L["ExportToExcel"], async () =>{ await DownloadAsExcelAsync(); }, IconName.Download);
            
            Toolbar.AddButton(L["NewDesign"], async () =>
            {
                await OpenCreateDesignModalAsync();
            }, IconName.Add, requiredPolicyName: ManagementPermissions.Designs.Create);

            return ValueTask.CompletedTask;
        }

This is our navigation to the edit page, again nothing too complicated

        private async Task NavigateToEditDesign(Guid designId, bool showEditModalOnLoad = false)
        {
            var url = $"/editdesign/{designId}";
            if (showEditModalOnLoad)
            {
                url += "?showEditModalOnLoad=true";
            }
            NavigationManager.NavigateTo(url);
        }

For the output we then see the below which is correct

Once navigation happens, we then see the below which is wrong and our edit page

Thank you

Alex


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please follow this: https://github.com/abpframework/abp/issues/21185

    I have refunded your ticket.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 30, 2024, 14:53