Hareeshchandera / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

connection.getParameters() does not return target custom parameters for a newly made connection #215

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi

If I make a connection from an endpoint of the type 'source' to an enpoint of 
the type 'target', and then delete the connection afterwards, the connection 
object being passed in the 'beforeDetach' function does not contain the my 
custom parameters of the target endpoint. I noticed that custom parameters with 
the same name get overridden, so I have checked twice that the names are unique.

I currently don't have an example online, but I am sure you should be able to 
reproduce this pretty easily. 

If you need something I'll make the effort and post something online for you to 
see. :)

Best regards

Karsten Jakobsen

Original issue reported on code.google.com by Karsten....@gmail.com on 4 Mar 2012 at 3:28

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Please supply a jsfiddle.

Original comment by simon.po...@gmail.com on 4 Mar 2012 at 7:51

GoogleCodeExporter commented 8 years ago
Hi 

Go to this jsfiddle example: http://jsfiddle.net/RxWf4/6/

Steps to reproduce the error:

1. Start by adding a breakpoint on line 89 in the 'beforeDetach'
2. Now make a connection from window3 to window2
3. Delete the connection you just made from window3 to window2

Inspect the variable 'allParameters' it contains:

myParam5: "window3Param1"
myParam6: "window3Param2"

If i'm not mistaken it should contain:

myParam3: "window2Param1"
myParam4: "window2Param2"
myParam5: "window3Param1"
myParam6: "window3Param2"

4. Now delete the connection from window1 to window4

Inspect the variable 'allParameters' again, it contains:

myParam1: "window1Param1"
myParam2: "window1Param2"
myParam7: "window4Param1"
myParam8: "window4Param2"

This looks OK.

Hope this example helps.

Original comment by Karsten....@gmail.com on 4 Mar 2012 at 9:00

GoogleCodeExporter commented 8 years ago
Thanks! I'll take a look.

Original comment by simon.po...@gmail.com on 4 Mar 2012 at 11:28

GoogleCodeExporter commented 8 years ago
Hi Simon

I noticed that the error also occurs in the bind method of 
'jsPlumbConnectionDetached' and 'jsPlumbConnection' when the connection should 
be ready.

Go to this jsfiddle: http://jsfiddle.net/RxWf4/19/

1. First set a linebreak on line 125 and on 141. Notice that i have set up som 
test values in the 'jsPlumbConnectionDetached' and 'jsPlumbConnection' binds.
2. First delete the existing connection from window1 to window4. This returns 
the correct custom parameters from the source window (window1) and target 
window (winow4) and stores them into 'allParameters':

myParam1: "window1Param1" (source)
myParam2: "window1Param2" (source)
myParam7: "window4Param1" (target)
myParam8: "window4Param2" (target)

3. Then make a connection from window3 to window2. Notice now that the variable 
'allParameters' only contains:

myParam5: "window3Param1" (source)
myParam6: "window3Param2" (source)

In my opinion, it should contain BOTH the source and the target endpoint 
parameters since the connection has been made:

myParam5: "window3Param1" (source)
myParam6: "window3Param2" (source)
myParam3: "window2Param1" (target)
myParam4: "window2Param2" (target)

4. Now move the existing connection you just made from window2 to window4. This 
also only shows the source endpoint parameters:

myParam5: "window3Param1" (source)
myParam6: "window3Param2" (source)

Where it should contain:

myParam5: "window3Param1" (source)
myParam6: "window3Param2" (source)
myParam7: "window4Param1" (target)
myParam8: "window4Param2" (target)

But notice that if i get the parameters directly from the endpoints the data is 
correct:

var endpoint1Parameters = connInfo.connection.endpoints[0].getParameters();
var endpoint2Parameters = connInfo.connection.endpoints[1].getParameters();

endpoint1Parameters: 
myParam5: "window3Param1" (source)
myParam6: "window3Param2" (source)
endpoint2Parameters;
myParam7: "window4Param1" (target)
myParam8: "window4Param2" (target)

Same thing goes for the 'jsPlumbConnectionDetached'.

Hope this helps to clarify things.

Original comment by Karsten....@gmail.com on 5 Mar 2012 at 2:27

GoogleCodeExporter commented 8 years ago
fixed in 1.3.8.

Original comment by simon.po...@gmail.com on 1 Apr 2012 at 6:16

GoogleCodeExporter commented 8 years ago
1.3.8 was released today.

Original comment by simon.po...@gmail.com on 1 Apr 2012 at 7:51