Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Only allow creation of links (Read 6306 times)
Dytiscus
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 28th, 2009
Only allow creation of links
May 14th, 2009 at 2:18pm
Print Post  
Hello. I work with the diagramview 301pre in imagemap mode and the SelectAfterCreate is true. I notice the following issues. When i drop a shape on the canvas a postback is fired wich is according plan, I need to bind the netdiagram shapes with our business objects. This is done via the Tag property. But at the end of the roundtrip no shape is selected on the client. I get round this problem by setting the node.selected property to true wich makes the shape selected. In the xml from the diagram is the selected element empty until i set the node.selected to true, the xml renders the selected element correctly then. Same problems for the relations. Does this property not work in imagemap mode?
Another thing is that i want to be able to draw and delete links but not modifying (change the origin or destination). Tries several settings but it seems no to be working. A possibility is to cancel the event client or server side but i don't want to give the user the abillity to change the link.
Another point i cant figure out is blocking the resize ability of the shapes on the canvas.
Hope someone can help me.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Only allow creation of links
Reply #1 - May 14th, 2009 at 2:37pm
Print Post  
Hi,

SelectAfterCreate is not implemented yet indeed.

The latest 3.0.1 build raises LinkModifying client-side events. Set the LinkModifyingScript to the name of a function that looks like this, and the user won't be able to move the link:

function onLinkModifying(sender,args)
{
     args.set_cancel(true));
}

This requires that the EnableItemsDOM property is enabled.

Regarding nodes, you might prevent resizing them by setting EnabledHandles = Move, or by handling the NodeModifying event.

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


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 28th, 2009
Re: Only allow creation of links
Reply #2 - May 18th, 2009 at 7:54am
Print Post  
Hi Stoyan,
I've tried as you suggested, the links are locked. The problem now is that i get a script error when i enable the ItemsDom. Tried it in ie8 and ff3. It happens when you move a shape. Select the shape to move. Handlers are set visible. Click in the middle to move it and the script error is thrown.

The error is thrown at the function

Code
Select All
Sys.Component.create = function Sys$Component$create(type, properties, events, references, element) {
    /// <summary locid="M:J#Sys.Component.create" />
    /// <param name="type" type="Type"></param>
    /// <param name="properties" optional="true" mayBeNull="true"></param>
    /// <param name="events" optional="true" mayBeNull="true"></param>
    /// <param name="references" optional="true" mayBeNull="true"></param>
    /// <param name="element" domElement="true" optional="true" mayBeNull="true"></param>
    /// <returns type="Sys.UI.Component"></returns>
    var e = Function._validateParams(arguments, [
        {name: "type", type: Type},
        {name: "properties", mayBeNull: true, optional: true},
        {name: "events", mayBeNull: true, optional: true},
        {name: "references", mayBeNull: true, optional: true},
        {name: "element", mayBeNull: true, domElement: true, optional: true}
    ]);
    if (e) throw e; 

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Only allow creation of links
Reply #3 - May 18th, 2009 at 8:51am
Print Post  
Hi,

Could you copy here your aspx and code-behind code that initializes the control? If possible please also email the diagram saved as XML to support@mindfusion.eu.

Thanks,
Stoyan
  
Back to top
 
IP Logged
 
Dytiscus
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 28th, 2009
Re: Only allow creation of links
Reply #4 - May 18th, 2009 at 10:55am
Print Post  
I've sended the code and xml via mail.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Only allow creation of links
Reply #5 - May 18th, 2009 at 2:04pm
Print Post  
This version should fix the script error, and also implements SelectAfterCreate:
https://mindfusion.eu/_beta/netdiag301_selaftercreate.zip

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


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 28th, 2009
Re: Only allow creation of links
Reply #6 - May 18th, 2009 at 3:03pm
Print Post  
Thanks for the new dll's. It fixed then ItemsDom. However the selectaftercreate is not working. When i look at the xml the selection element is empty all the time. Even if on screen a shape is selected and its handles are shown.

Another thing i noticed (in both versions) is that i get a postback when a shape is selected and the canvas is clicked. I haven't implemented the onclick. This only occurs when there is a shape selected clientside. To repeat the error, drag a shape on the canvas. Click it to select it. Click on the canvas and there is the postback.

Hope i explained it well enough for you.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Only allow creation of links
Reply #7 - May 18th, 2009 at 3:17pm
Print Post  
At what point of the page execution are you saving the diagram to XML?
  
Back to top
 
IP Logged
 
Dytiscus
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 28th, 2009
Re: Only allow creation of links
Reply #8 - May 18th, 2009 at 3:27pm
Print Post  
At the page init and at the page unload.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Only allow creation of links
Reply #9 - May 18th, 2009 at 3:32pm
Print Post  
The postback when clicking over the canvas is done in order to clear the selection. Saving to XML from Page_Init might be too early; the control creates the new node and selects it in the LoadPostData stage of the page execution, which comes after the Init stage.

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


I love YaBB 1G - SP1!

Posts: 7
Joined: Apr 28th, 2009
Re: Only allow creation of links
Reply #10 - May 19th, 2009 at 8:37am
Print Post  
Thx for the reply. I've tried a few things but the selecting after create doesn't work properly. I saved the xml at loadcomplete and unload event. The scenario was:

    [1]EmptyCanvas
    [2]Drag a shape on the canvas
    [3]Click a shape to select it
    [4]Drag another shape on the canvas

I sended the xml's by mail.

Is there a way to make the canvas cancel the postback when the canvas is clicked for deslecting?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Only allow creation of links
Reply #11 - May 19th, 2009 at 11:31am
Print Post  
Indeed, it works only after drawing nodes with the mouse, but not after dragging them from the shapelistbox. We'll fix it for the version 3.0.1 release.

We'll implement some way to disable postback for clearing the selection after the release; we delayed it too much already.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint