Open Closed

Notifications(Bell Icon) component ShowNotifications button is not working #6728


User avatar
0
cetin.sahin created
  • ABP Framework version: v8.0
  • UI Type: lazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

we developed Notifications(Bell Icon) component with https://docs.abp.io/en/abp/latest/UI/Blazor/Toolbars document. We Used LeptonX template. Notifications(Bell Icon) is showing but onclick event not working. our code

Blazor Module cs

private void ConfigureToolbar()
{
    Configure<AbpToolbarOptions>(options =>
    {
        options.Contributors.Add(new MyToolbarContributor());
    });
}

public class MyToolbarContributor : IToolbarContributor
{
    public Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
    {
        if (context.Toolbar.Name ==  LeptonXToolbars.Main)
        {
            context.Toolbar.Items.Insert(0, new ToolbarItem(typeof(NotificationsComponent)));
        }

        return Task.CompletedTask;
    }
}
and NotificationsComponent.razor

 

@inherits Volo.Abp.AspNetCore.Components.AbpComponentBase
<div class="nav-link">
    <i class="fas fa-bell" @onclick="ShowNotifications"></i>
</div>
@code {
    private async Task ShowNotifications()
    {
        await Message.Info("TODO: Show notifications");
    }
}


5 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello , Can you please give steps to reproduce the issue. Thank you.

  • User Avatar
    0
    cetin.sahin created

    I give already all code in my project . I think https://docs.abp.io/en/abp/latest/UI/Blazor/Toolbars document is lack. When I click Notifications(Bell Icon) ShowNotifications event is not triggered.

  • User Avatar
    0
    cetin.sahin created

    and NotificationsComponent.razor

    @inherits Volo.Abp.AspNetCore.Components.AbpComponentBase <div class="nav-link"> <i class="fas fa-bell" @onclick="ShowNotifications"></i> </div> @code { private async Task ShowNotifications() { await Message.Info("TODO: Show notifications"); } }

  • User Avatar
    0
    cetin.sahin created

    Hi ; I resoılved this issue . Can you refund my ticket ? I replaced NotificationsComponent.razor code in https://docs.abp.io/en/abp/latest/UI/Blazor/Toolbars document

    @inherits Volo.Abp.AspNetCore.Components.AbpComponentBase <div class="nav-link"> <i class="fas fa-bell" @onclick="ShowNotifications"></i> </div> @code { private async Task ShowNotifications() { await Message.Info("TODO: Show notifications"); } }

    @inherits Volo.Abp.AspNetCore.Components.AbpComponentBase <div class="nav-link" @onclick="ShowNotifications" > <i class="fas fa-bell"></i> </div> @code { private async Task ShowNotifications() { await Message.Info("TODO: Show notifications"); } }

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Yes sure , your ticket is refunded. Thanks for giving the updates.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15