Nevron Forum

NDiagramCallbackService is undefined ???

https://www.nevron.com/Forum/Topic4405.aspx

By Jeremy Radosh - Tuesday, October 26, 2010

I'm a new customer and I'm simply trying to implement the Spring Layout based on the sample code provided (http://examplesaspnetdiagram.nevron.com/ -> Layouts -> Spring Layout).  I can get the code to work if I omit the properties AjaxEnabled="True", OnAsyncCustomCommand and OnAsyncQueryCommandResult from the NDrawingView tag.  However if I leave them in I get the following run-time error... "NDiagramCallbackService is undefined".  I cannot find any documentation on "NDiagramCallbackService" (or course it doesn't help that the search function is not working on your documentation web site).

 

Any ideas what's going on?


Thanks

Jeremy

By Nevron Support - Wednesday, October 27, 2010

Hi Jeremy,

It seems that our script files are not registered correctly. Can you check the web.config file for the following lines:

system.web
httpHandlers
add verb="*" path="NevronScriptManager.axd" type="Nevron.UI.WebForm.Controls.NevronScriptManager" validate="false"
httpHandlers
system.web

You can see the configuration from our visual studio 2008 local examples.
Please also check when the page is rendered from view->source of the browser for the following line:

<script src="NevronScriptManager.axd?Assembly=Nevron.UI.WebForm.Controls&Resource=Nevron.UI.WebForm.Controls.EmbeddedScripts.NevronR.js" type="text/javascript"></script>


If There is such line try to navigate to it. Also can you check if our assemblies are in the bin folder of the project. If there are not just select them from the references section in the studio and set the property copy local to be true.

By Jeremy Radosh - Wednesday, October 27, 2010

I added the httpHandler line and also set the references to "copy local" and the problem went away.  However the "script" tag is not in the source of the page.

My next problem... I want tooltips and clickable nodes on my spring diagram.  I've added code to accomplish this, but yet nothing renders in the browser (no tooltip or clickable link).

The code is here...

            for (int i = 0; i < technologies.Count; i++)
            {
                NShadowStyle ns = new NShadowStyle(Color.Black);
                technologies[i].m_Shape.Style.ShadowStyle = ns;
                technologies[i].m_Shape.Style.ShadowStyle.FadeLength = new NLength(2);
                technologies[i].m_Shape.Style.ShadowStyle.OffsetX = new NLength(1);
                technologies[i].m_Shape.Style.ShadowStyle.OffsetY = new NLength(2);

                NInteractivityStyle xxx = new NInteractivityStyle(true, "1", "test tooltip", CursorType.Arrow, "http://my.yahoo.com");
                xxx.GenerateImageMapObject = true;
                xxx.GeneratePostback = true;
                technologies[i].m_Shape.Style.InteractivityStyle = xxx;
                Document5 = NDrawingView5.Document;
                Document5.EventSinkService.NodeClick += new NodeViewEventHandler(EventSinkService_NodeClick);

                if (technologies[i].m_Enables == null)
                {
                    for (int x = 0; x < technologies.Count; x++)
                    {
                        if (x == i)
                            continue;
                        if (technologies[x].m_Enables == technologies[i])
                        {
                            NDrawingView5.Document.ActiveLayer.AddChild(technologies[i].m_Shape);
                            break;
                        }
                    }
                }
                else
                {
                    NDrawingView5.Document.ActiveLayer.AddChild(technologies[i].m_Shape);
                }
            }

By Nevron Support - Wednesday, October 27, 2010

Regarding the interactivity styles – take a look at the Image Map online example. It demonstartes how to show tooltips and redirect the browser to another page when the user clicks on a shape.

By Jeremy Radosh - Wednesday, October 27, 2010

I saw that example and took some code from it.  However I cannot get it to work in the spring layout example (see my code fragment previously posted).

What step am I missing to make the tooltips show up?