Open Closed

Open Entity History Modal from Blazor Page #4911


User avatar
0
maggieryanmail@gmail.com created
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

How do I open the entity history change modal from my index page in blazor?

I tried:

@inject EntityChangeHistoryModal EntityHistoryModal;

await EntityHistoryModal.OpenAsync(EntityFullName, entityId.ToString());

I get a Null reference exception.


4 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Can you share the full error logs? thanks.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can try this:

    .razor file

    <EntityChangeHistoryModal @ref="EntityChangeHistoryModal"/>
    

    .razor.cs file

    protected EntityChangeHistoryModal EntityChangeHistoryModal;
    
    public async Task OpenEntityChangeHistoryModal(Guid id)
    {
      await EntityChangeHistoryModal.OpenAsync(EntityTypeFullName, id.ToString())
    }
    
  • User Avatar
    0
    maggieryanmail@gmail.com created

    That worked - thank you!

    Is there any way to modify the contents of the modal?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You have to replace the component: https://docs.abp.io/en/abp/latest/UI/Blazor/Customization-Overriding-Components?UI=Blazor

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11