Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to create a shapeboxlistener in script? (Read 3115 times)
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
how to create a shapeboxlistener in script?
Apr 29th, 2012 at 11:55am
Print Post  
This doesn't work, can you tell me what will ?   

    var list = document.getElementById('ShapeListBox1');
    var listener = new ShapeListBoxListener();
    list.addShapeListener(listener);
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to create a shapeboxlistener in script?
Reply #1 - Apr 30th, 2012 at 6:19am
Print Post  
You cannot implement a Java interface in JavaScript as far as I know. If you need to handle the events from ShapeListBoxListener, we will add some *Script properties that will call JavaScript functions similar to the ones in DiagramView.
  
Back to top
 
IP Logged
 
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
Re: how to create a shapeboxlistener in script?
Reply #2 - Apr 30th, 2012 at 9:24am
Print Post  
Thanks for your answer. It would be great if there were eventhandlers from script.
I especialy would like an eventhandler for "ShapeSelected"
  
Back to top
 
IP Logged
 
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
Re: how to create a shapeboxlistener in script?
Reply #3 - Apr 30th, 2012 at 11:03am
Print Post  
I found a solution by using a second diagramview as my shape-selector. I show all desired shapes as shapenodes and set behavior to Pan.
Now I have a great shape-selector (without dragging yet)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to create a shapeboxlistener in script?
Reply #4 - May 2nd, 2012 at 8:39am
Print Post  
Check your PM page (there's a link to it at the top of the forum). The updated version there implements ShapeSelectedScript, ShapeRemovedScript and ShapeRenamedScript in Java mode, which you can use like this:

Code
Select All
<ndiag:ShapeListBox runat="server"
	ID="shapeList"
	ClientSideMode="JavaApplet"
	Width="150px" Height="480px"
	ShapeSelectedScript="onShapeSelected">
</ndiag:ShapeListBox>

function onShapeSelected(sender, args)
{
	alert(args.getShape().getId());
}
 



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