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

Dialog closing stop to work when calling Javascript

Thread ID:

Created:

Updated:

Platform:

Replies:

147100 Sep 1,2019 07:58 PM UTC Sep 2,2019 03:02 PM UTC Blazor 3
loading
Tags: Dialog
Benoit
Asked On September 1, 2019 07:58 PM UTC

Hi!

I found a strange behavior with the latest packages (.Net Core 3.0 preview 8, Syncfusion.EJs.Blazor 17.2.0.47.Beta) with the dialog component.

I attached the sample that reproduce the issue. Just run it. If you click on the Open Dialog button, it works. Then you can click on Ok or Cancel button and dialog will close.
Now, stop the application. Uncomment the line 30 in Index.razor file

Line 30 : 
// await JSRuntime.InvokeAsync<object>("window.testCallJs.startCallJs");

Then run the app again. Click on the Open Dialog button. The dialog opens. But if you try to close it with Ok or Cancel button, it doesn't work.

If you take a look in the Index.razor file, you will see that I tried to use DialogEvents, but without any success.

This code worked when my application was running under .Net core 3.0 preview 7 and syncfusion 17.2.0.40.

Best regards,
Benoit

Attachment: BlazorApp1_6e6fd58.zip

Pandiyaraj Muniyandi [Syncfusion]
Replied On September 2, 2019 06:39 AM UTC

Hi Benoit, 
 
Greetings from Syncfusion support. 
 
We have validated the reported issue with the shared sample and able to reproduce from our end. The JSRuntime.InvokeAsync method call doesn’t stop without getting a result from the async method call, due to this further action not working in the sample. As per shared sample, startCallJS method not returns any value, so we suggest you change the open dialog button handler return type as void from Task as follows and check from your end. 
 
 
    private async void OnBtnClick() 
    { 
        this.DialogObj.Show(); 
        await JSRuntime.InvokeAsync<object>("window.testCallJs.startCallJs"); 
    } 
 
 
We have modified your sample with above changes, get it from below link 
 
Regards, 
Pandiyaraj M 


Benoit
Replied On September 2, 2019 02:29 PM UTC

Hi Pandiyaraj,

Thanks for your help. It works.

Benoit

Pandiyaraj Muniyandi [Syncfusion]
Replied On September 2, 2019 03:02 PM UTC

Hi Benoit 
 
Most welcome!  
 
Regards,  
Pandiyaraj M 


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