Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic NodeListView is empty although values are passed to it (Read 4147 times)
mandz
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Joined: Mar 12th, 2013
NodeListView is empty although values are passed to it
May 10th, 2013 at 1:54am
Print Post  
Hi there,

I'm using the NodeListView control and, although it worked at some stage, it is not showing any items any more.  Here is my code:

   
Code (HTML)
Select All
<div style="width:750px;height:700px; border:1px solid black;">
        @Html.DiagramView((DiagramView)ViewBag.DiagramView)
    </div>

    <div style="width:200px; height:200px; position:relative; top:-702px; left:760px; border:1px solid black;">
        @Html.Overview((Overview)ViewBag.Overview)
    </div>

    <div style="width:200px; height:498px; position:relative; top:-702px; left:760px; border:1px solid black;">
        @Html.NodeListView((NodeListView)ViewBag.NodeListView)
    </div>   



In my controller I do this:

Code (C++)
Select All
 ViewBag.NodeListView = SetupNodeList(nodelistName); 



and this:

Code (C++)
Select All
private NodeListView SetupNodeList(string nodelistName)
        {
            NodeListView nodelist = new NodeListView(nodelistName);
            nodelist.SetWidth(200);
            nodelist.SetHeight(498);

            var node1 = new MindFusion.Diagramming.ShapeNode();
            node1.Brush = new MindFusion.Drawing.SolidBrush(Color.Yellow);
            node1.Shape = Shapes.RoundRect;
            nodelist.AddNode(node1, "Task");

            var node2 = new MindFusion.Diagramming.ShapeNode();
            node2.Brush = new MindFusion.Drawing.SolidBrush(Color.Orange);
            node2.Shape = Shapes.Decision;
            nodelist.AddNode(node2, "Decision");

            var node3 = new MindFusion.Diagramming.ShapeNode();
            node3.Brush = new MindFusion.Drawing.SolidBrush(Color.Green);
            node3.Shape = Shapes.Ellipse;
            nodelist.AddNode(node3, "Start");

            var node4 = new MindFusion.Diagramming.ShapeNode();
            node4.Brush = new MindFusion.Drawing.SolidBrush(Color.Red);
            node4.Shape = Shapes.Ellipse;
            nodelist.AddNode(node4, "End");

            return nodelist;
        } 



When I run the app I only see an empty nodelistview.  Like I said, this code worked before showing only those 4 items.  When I debug and stop at the line in the HTML where the NodeListView is declared using the Razor syntax, ViewBag.NodeListView does have a value.  It contains the 4 items I want displayed.  Why is it not displaying it?  Any help will be appreciated.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView is empty although values are passed to it
Reply #1 - May 10th, 2013 at 6:13am
Print Post  
Hi,

We could not reproduce this. Could you check if there aren't any JavaScript errors shown in the browser's console? The onLoad script might stop executing if there's an error, preventing the deserialization of NodeListView's content.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mandz
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Joined: Mar 12th, 2013
Re: NodeListView is empty although values are passed to it
Reply #2 - May 12th, 2013 at 10:00pm
Print Post  
Hi Stoyan,
I don't have an onLoad script.  I put just the necessary bits in a separate view and it still doesn't work.  Here it is:

Code (C++)
Select All
public ActionResult Index2(int? id)
        {
            ViewBag.NodeListView = SetupNodeList("nodelist");
            return View();
        }  



Code (HTML)
Select All
@using System.Drawing;
@using MindFusion.Diagramming;
@using MindFusion.Diagramming.Mvc
@using SolidBrush = MindFusion.Drawing.SolidBrush;
@using LinearGradientBrush = MindFusion.Drawing.LinearGradientBrush;

@{
    ViewBag.Title = "Index2";
}

<h2>Index2</h2>

<div style="width:200px; height:498px; border:1px solid black;" >
    @Html.NodeListView((NodeListView)ViewBag.NodeListView)
</div>  



I looked at the code using Firebug Lite, but can't see any errors other than an error in the MicrosoftAjax.cs file, which also shows for your examples.  The examples work despite showing this.
  
Back to top
 
IP Logged
 
mandz
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Joined: Mar 12th, 2013
Re: NodeListView is empty although values are passed to it
Reply #3 - May 12th, 2013 at 10:01pm
Print Post  
Code for SetupNodeList hasn't changed.  It's still as in the original post.
  
Back to top
 
IP Logged
 
mandz
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 28
Joined: Mar 12th, 2013
Re: NodeListView is empty although values are passed to it
Reply #4 - May 12th, 2013 at 10:24pm
Print Post  
I got it working by elimination.  Problem is the name I'm giving the nodelist.  It cannot be 'nodelist'.  'nodeList' and 'nodelist1' works.  See capitalization.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView is empty although values are passed to it
Reply #5 - May 13th, 2013 at 10:11am
Print Post  
We can't reproduce this with either name. Are you sure there isn't any other element on the page with id = 'nodelist'?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint