We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Conditionally adding dialog buttons doesn't work properly

Thread ID:

Created:

Updated:

Platform:

Replies:

150397 Jan 6,2020 12:43 AM UTC Feb 5,2020 06:45 PM UTC Blazor 5
loading
Tags: Dialog
Rodolfo
Asked On January 6, 2020 12:43 AM UTC

In the buttons added later events are not raised. Buttons are not removed. Example:

@page "/dialog01"
@using Syncfusion.EJ2.Blazor.Popups
@using Syncfusion.EJ2.Blazor.Buttons

<EjsButton @onclick="@OnBtnClick">Open Dialog</EjsButton>
<EjsDialog Width="320px" @bind-Visible="@DialogVisible" ShowCloseIcon="true" IsModal="true">
    <DialogTemplates>
        <Header> Update Required!!! </Header>
        <Content> Would you like to install the latest updates? </Content>
    </DialogTemplates>
    <DialogButtons>
        @if (altVisible)
        {
            <DialogButton ButtonModel="@DialogBtn" OnClick="@OnClicked"></DialogButton>
        }
        else
        {
            <DialogButton ButtonModel="@DialogNoBtn" OnClick="@OnClicked"></DialogButton>
        }
    </DialogButtons>
</EjsDialog>


@code {
    public bool altVisible = false;
    public bool DialogVisible { get; set; } = false;
    public ButtonModel DialogBtn = new ButtonModel
    {
        Content = "Update",
        IsPrimary = true
    };
    public ButtonModel DialogNoBtn = new ButtonModel
    {
        Content = "Later",

    };

    private void OnBtnClick()
    {
        altVisible = !altVisible;
        this.DialogVisible = true;
    }
    private void OnClicked()
    {
        DialogVisible = false;
    }
}



As a side note, not related to the previous problem, the dialog html is not removed from the DOM when the Component is disposed. After showing many dialogs the number of elements in the body keep increasing. Is the control in preview that has so many bugs?

Indrajith Srinivasan [Syncfusion]
Replied On January 6, 2020 12:44 PM UTC

Hi Rodolfo, 
  
Currently, we validating the reported issue, will update further details shortly.

 
Regards, 
Indrajith 


Indrajith Srinivasan [Syncfusion]
Replied On January 6, 2020 05:09 PM UTC

Hi Rodolfo, 
 
Greetings from Syncfusion support 
 
Query 1: Conditionally adding dialog buttons doesn't work properly 
 
We have validated the reported scenario. The previously rendered buttons are maintained when rendering it based on conditional approach. As well as few dialog elements are still persist after the component is disposed. We consider both issues as bug in our end. We will include the fix in weekly patch release which is planned to roll-out on 14th January. 
 
You can now track the current status of the report, review the proposed resolution timeline, and contact us for any further inquiries through this link: 
 
 
Until then, we suggest you to use the below workaround solution to render the dialog buttons using the FooterTemplate and DialogButtons as follows. 
 
 
 
Query 2: Is the control in preview that has so many bugs? 
 
The component moved from preview to final in last 2019 Volume 4 release.  
 
Regards, 
Indrajith 


Pandiyaraj Muniyandi [Syncfusion]
Replied On January 17, 2020 05:23 AM UTC

Hi Rodolfo, 
 
Sorry for the inconvenience caused. 
 
We could not include the fix with our last weekly patch release due to complexity on resolving the reported issue from our end. We will resolve and include the fix in our 2019 Volume 4 SP1 release, which is expected to roll-out on end of January. 
 
Regards, 
Pandiyaraj 


Indrajith Srinivasan [Syncfusion]
Replied On January 31, 2020 05:29 PM UTC

Hi Rodolfo, 
 
We are glad to announce that our Essential Studio Volume 4, 2019 service pack release (v17.4.0.46) is rolled out and is available for download under the following link. And the fix for Dynamic render of dialog buttonsis included. We could not include the fix for “Dialog html is not removed from the DOM when the Component is disposed” with our Volume 4 SP 1 release due to complexity on resolving the reported issue from our end. We will resolve and include the fix in our upcoming patch release scheduled to roll-out on 5th February 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Indrajith 


Indrajith Srinivasan [Syncfusion]
Replied On February 5, 2020 06:45 PM UTC

Hi Rodolfo, 
 
Thanks for your patience, 
 
We have resolved the issue with “Dialog html is not removed from the DOM when the Component is disposed” and the fix is now available with the patch release version 17.4.47. Could you please upgrade your package to this version to resolve the issue from your end. 
 
Regards, 
Indrajith 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon