Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Interactivity in ImageMap mode (Read 4853 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Interactivity in ImageMap mode
Dec 1st, 2008 at 12:11pm
Print Post  
The ImageMap mode in NetDiagram 2.1 allows drawing nodes and links on the client side, selecting existing items and modifying them. After an item is drawn or resized, the control posts back and raises a server event.

We'll be starting official beta tests in a couple of weeks; if anyone wants to try it now, please download a prerelease build here:
https://mindfusion.eu/_beta/Interactivity.zip

Now the control requires a ScriptManager to exist on the page, as shown in the included sample project.

Please let us know if you have any comments or suggestions.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Interactivity in ImageMap mode
Reply #1 - Dec 2nd, 2008 at 1:21pm
Print Post  
The link above is for the .NET 3.5 build of NetDiagram. Now we have compiled a .NET 2 version:

https://mindfusion.eu/_beta/interactivity_aspnet2.zip

Client-side interactivity relies heavily on the Microsoft Ajax Extensions for ASP.NET library for browser independent DOM access. Since it is a separate download and does not come with the standard ASP.NET 2 runtime, we have moved the client-side interaction functionality to a ControlExtender-derived class called InteractivityExtender. Now the core DiagramView class and the "diagramming.webforms.dll" don't have references to the MS.Ajax assembly "system.web.extensions.dll". To enable client-side interaction, add a reference to InteractivityExtender.dll, add an InteractivityExtender instance to the form and set its TargetControlID to the DiagramView.ID. That's demonstrated in the following sample:

https://mindfusion.eu/_samples/netdiag_Interactivity.zip

Stoyan
  
Back to top
 
IP Logged
 
Clopy
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jan 13th, 2009
Re: Interactivity in ImageMap mode
Reply #2 - Jan 13th, 2009 at 12:13pm
Print Post  
Hello,

Is there a way to capture the NodeClicked event when using imagemap in interactivity mode?

I'm using it to display a panel with several "tools" (change color, name of node, store some info  about the selected node to the database etc). But in 2.1 with interactivity enabled, the NodeClick event never gets raised.

Thank you
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Interactivity in ImageMap mode
Reply #3 - Jan 13th, 2009 at 12:39pm
Print Post  
Hi,

It worked fine in my test site. Could you copy your DiagramView initialization code here?

Stoyan
  
Back to top
 
IP Logged
 
Clopy
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jan 13th, 2009
Re: Interactivity in ImageMap mode
Reply #4 - Jan 13th, 2009 at 12:51pm
Print Post  
Ok. I tried also on the beta sample site:
Code
Select All
<asp:ScriptManager ID="scriptManager" runat="server">
        </asp:ScriptManager>
        <ndiag:DiagramView ID="diagramView" runat="server"
            ClientSideMode="ImageMap" Height="600px" Width="800px"
            OnNodeCreated="OnNodeCreated" OnNodeClicked="OnNodeClicked">
        </ndiag:DiagramView>
 



With code behind:
Code
Select All
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }


internal void OnNodeCreated(object sender, NodeEventArgs e)

{


ShapeNode shape = e.Node as ShapeNode;


if (shape != null)



shape.Text = "I've been drawn on the client side!";

}

    internal void OnNodeClicked(object sender, NodeEventArgs e)
    {
        ShapeNode shape = e.Node as ShapeNode;
        if (shape != null)
            shape.Text = "I've been clicked on the client side!";

    }
}
 



but it doesn't trigger the OnNodeClicked event (i've put a debug sign to see if it hits but nothing.

On my normal project (VB.NET) , this is how I create the diagram:
Code
Select All
<cc1:InteractivityExtender runat="server" ID="extPT" TargetControlID="ProblemTree" />
                      <ndiag:DiagramView ID="ProblemTree" runat="server" ClientSideMode="ImageMap" />
 


and this is the code that should be run:

Code
Select All
Protected Sub ProblemTree_NodeClicked(ByVal sender As System.Object, ByVal e As MindFusion.Diagramming.NodeEventArgs) Handles ProblemTree.NodeClicked
        pnlDetails.Visible = True

[...]
    End Sub
 

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Interactivity in ImageMap mode
Reply #5 - Jan 13th, 2009 at 12:58pm
Print Post  
oh, great, it works under IE but not Firefox. Our developer will check this.
  
Back to top
 
IP Logged
 
Clopy
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jan 13th, 2009
Re: Interactivity in ImageMap mode
Reply #6 - Jan 13th, 2009 at 1:05pm
Print Post  
true. It works under IE (7 at least).

Thank you for the quick response
  
Back to top
 
IP Logged
 
Clopy
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Jan 13th, 2009
Re: Interactivity in ImageMap mode
Reply #7 - Jan 14th, 2009 at 10:47am
Print Post  
Hello again,
one more question.

Is it possible (without messing with the NetDiagram source code) using ImageMap interactivity, to disable interactive creating of nodes and links from users?

(e.g. only let them select and move the nodes)

Thank you,
Mike
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Interactivity in ImageMap mode
Reply #8 - Jan 14th, 2009 at 11:53am
Print Post  
The click event in firefox should be fixed now. Check the private messages page for a download link.

Set DiagramView.Behavior = Modify to enable only selecting and moving nodes.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint