ThreadPool Callback

When using Type=HTML I sometimes get the following error

ThreadPool Callback threw an unhandled exception of type Microsoft.JSInterop.JSException


This only happens when using Type=HTML.  If I try Type=Shape everything is okay.  Sometimes I can drop 10 items onto the diagram with no problems then other times I'll get an error after dropping just 1 item

 I am using the latest version on Syncfusion Blazor


5 Replies

GG Gowtham Gunashekar Syncfusion Team August 4, 2021 12:20 PM UTC

Hi John, 
 
We can be able to replicate the reported issue at our end, we are validating the issue and update you with more detail on 6th August,  2021. We appreciate your patience until then. 
 
Regards, 
Gowtham  



GG Gowtham Gunashekar Syncfusion Team August 6, 2021 01:02 PM UTC

Hi John,    
    
Reported Issue : An exception accrues when adding the HTML node to the diagram using drop event 
 
We can reproduce the issue and confirmed this as a defect. We have logged a defect report for this issue. We will fix this issue and provide the patch on 24th August,2021 weekly patch release.    
     
    
Regards, 
Gowtham 



GG Gowtham Gunashekar Syncfusion Team August 19, 2021 11:04 AM UTC

Hi John,


We deeply regret for the inconvenience caused. On the further analysis of the shared sample, we can able to fixed the issue in sample side itself. In the drop event, you have added the node without node ID. By default, in the diagram, if we do not set ID for node means then random ID gets generated for the node. So random ID of number gets added for the node. By default, if we try to get any element which ID is number from DOM using query selector means we face exception. To resolve this, add the ID for the dropped node as below code snippet. So that newly added node gets added properly in the node without any exception.


public void OnDrop(IBlazorDropEventArgs args)

        {

            args.Cancel = true;

            var NewNode = args.Element.Node;

            Diagram.Nodes.Add(new DiagramNode()

            {

                // Set the ID for the node

                Id = "node" + Diagram.Nodes.Count,

                OffsetX = NewNode.OffsetX,

                OffsetY = NewNode.OffsetY,

                Width = NewNode.Width,

                Height = NewNode.Height,

                Shape = new DiagramShape()

                {

                    Type = Shapes.HTML,

                }

 

            });

        }




We have attached a video demonstration of how newly added node gets added properly in the node without any exception.


Video: https://www.syncfusion.com/downloads/support/directtrac/general/ze/NODETE~1-443852115


We have modified the sample and attached for your reference. Please find the sample in below link


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/NodeTemplate-BlazorPalette916248280


Regards

Gowtham



SS Sarasilmiya Shahul Hameed Syncfusion Team August 20, 2021 04:42 AM UTC

I'm getting a access denied when viewing https://www.syncfusion.com/feedback/27690/an-exception-accrues-when-adding-the-html-node-to-the-diagram-using-drop-event I thought I would have been able to see this as it was myself who raised the bug.


GG Gowtham Gunashekar Syncfusion Team August 23, 2021 12:04 PM UTC

 
Hi John, 
 
Sorry for the inconvenience caused. We have created the feedback link because of the some miscommunication. We have to fix the reported issue in application level and we already provide the fix in the previous update. Please check the feedback link now. We suggest you fix the issue in application side. In diagram its mandatory to set the node and connector id as unique alphanumerical id. In the shared sample you have set the numeric value as the Id for the node that leads to the reported issue. To resolve this, add the unique alphanumerical ID for the dropped node as below code snippet.  
 
Code snippet: 
public void OnDrop(IBlazorDropEventArgs args) 
        { 
            args.Cancel = true; 
            var NewNode = args.Element.Node; 
            Diagram.Nodes.Add(new DiagramNode() 
            { 
                // Set the ID for the node 
                Id = "node" + Diagram.Nodes.Count, 
                OffsetX = NewNode.OffsetX, 
                OffsetY = NewNode.OffsetY, 
                Width = NewNode.Width, 
                Height = NewNode.Height, 
                Shape = new DiagramShape() 
                { 
                    Type = Shapes.HTML, 
                } 
  
            }); 
        } 
 
Regards 
Gowtham 


Loader.
Up arrow icon