Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Silverlight ShapeListBox not displaying anything (Read 6321 times)
jagdipa
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 52
Joined: Jun 23rd, 2011
Silverlight ShapeListBox not displaying anything
Jul 15th, 2011 at 4:00pm
Print Post  
I am trying to get a simple example of the Diagram working in Silverlight. My problem is that I cannot seem to get the shapleListBox to display. Are there any examples I can download and use?

Here is the code I am using:

    <div style="border: 2px solid Green;">
       <ndiag:DiagramView ID="DiagramView1" runat="server" Behavior="DrawLinks"
           ClientSideMode="Silverlight" Height="256px"
           Width="256px">
       </ndiag:DiagramView>
    <br />
    </div>

   
    <div style="border: 2px solid Red;">
       <ndiag:ShapeListBox ID="ShapeListBox1" runat="server"
           style="background-color: white" ClientSideMode="Silverlight">
       </ndiag:ShapeListBox>
    <br />
    </div>
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Silverlight ShapeListBox not displaying anythi
Reply #1 - Jul 15th, 2011 at 4:51pm
Print Post  
Sorry, we don't have a ShapeListBox implemented in Silverlight yet. There's a similar control, called NodeListView, that can contain any kind of nodes and clones them after drag-and-drop, but it does not have an ASP.NET wrapper class.

What you could do is build your own version of ClientDiagramApp.xap that contains a NodeListView instance, and then it will get loaded together with the Diagram. You can find the source project for the xap file here:
https://www.mindfusion.eu/_samples/netdiag.xap.zip

You could also use this to implement other client-side logic in Silverlight / C# instead of JavaScript.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jagdipa
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 52
Joined: Jun 23rd, 2011
Re: Silverlight ShapeListBox not displaying anythi
Reply #2 - Jul 18th, 2011 at 8:59am
Print Post  
Actually, I was trying to get the Java version working but with no luck. I keep getting that 'magic value incompatible' error.

I was trying to sort that out when I found the error did not occur on the Silverlight version.

I think I will try the Java version again, and try to fix the problems with it. I have tried to extract the .jar in the directory, but still getting errors.
  
Back to top
 
IP Logged
 
jagdipa
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 52
Joined: Jun 23rd, 2011
Re: Silverlight ShapeListBox not displaying anythi
Reply #3 - Jul 18th, 2011 at 9:33am
Print Post  
I just had a thought.

From what I have read, the problem is loading the JDiagram.jar file from an ASP.NET site that requires authenticating.

So why not load the file from a public site, i.e. why not load this file from mindfusion. So I can put the jar location as http://mindfusion.ie/JDiagram.jar?

I hope I dont get the same problems when trying to load my custom shapes library!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Silverlight ShapeListBox not displaying anythi
Reply #4 - Jul 18th, 2011 at 10:41am
Print Post  
Yes, this usually happens because of Forms Authentication, but it could be caused by other problems as well. It seems that any HTTP reply that the Java plugin cannot recognize is handled as a binary stream from which the plugin tries to load the compiled Java classes. Then you get this message if there's no Java bytecode code in the stream but some unknown error response.

If you are using authentication, you can work around this by moving the applet to unprotected area of your site. If not, enable IIS logging and check what response is logged for the "GET JDiagram.jar" request.

If you have problems with shape libraries, make sure the file extension you are using is in the IIS Mime Types list. E.g. use "xml" extensions or add whatever extension you are using as text/xml type.

I don't know if we can host the file ourselves; we don't have any idea how many end-users our clients' applications will have in total and what kind of traffic that will generate Smiley

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Silverlight ShapeListBox not displaying anythi
Reply #5 - Jul 18th, 2011 at 10:46am
Print Post  
By the way Netdiagram will have a "canvas" mode soon (see http://mindfusion.eu/Forum/YaBB.pl?board=jsdiag_disc;action=display;num=1310492528). This will rid us of many problems we have with Java, but it will support only ShapeNodes for some time and will work only on latest-generation browsers.
  
Back to top
 
IP Logged
 
jagdipa
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 52
Joined: Jun 23rd, 2011
Re: Silverlight ShapeListBox not displaying anythi
Reply #6 - Jul 18th, 2011 at 11:24am
Print Post  
Hi Stoyo,

Does the jarLocation support full web addresses?

My company website is https://portal.aaa.com. But I am trying to host the JDiagram file at http://www.aaa.com/JDiagram

So I am using the asp:Diagram at https://portal.aaa.com/test.aspx, with the jarlocation set at http://www.aaa.com/JDiagram

Using fiddler, it looks like it is trying to get to https://portal.aaa.com/www.aaa.com/JDiagram !!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Silverlight ShapeListBox not displaying anythi
Reply #7 - Jul 18th, 2011 at 11:45am
Print Post  
Hi,

Yes, that's supported. It should try other combinations of base url + local url only if the first GET request fails (e.g. GET JarLocation_literal_value returns 404). Have you also added the ".jar" extension to the property value?

You should also move the shape library file to the same location. Otherwise you will get java.security.AccessControlExceptions since applets can load files only from the same base address.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jagdipa
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 52
Joined: Jun 23rd, 2011
Re: Silverlight ShapeListBox not displaying anythi
Reply #8 - Jul 18th, 2011 at 1:53pm
Print Post  
Hi Stoyo,

I have tried to access the JDiagram from my public site with no success. I have managed to get the Java console open, and I have pasted the results below. I have editted the location out, but I will sent the location to you via personnal message so that you can test it if you like.

The output below shows that java doesnt go to the public site to get the JDiagram file. (see the first http line)

Another issue I have found is that the aspx page that you put the control on must also be in a public folder. This is a little dangerous, but I can get around this.

----------------------------------------------------------------

basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@f07355
basic: Plugin2ClassLoader.addURL parent called for http://localhost:65116/HRA_HFWv1/HTA/www.MySite.ltd.uk/JDiagram.jar
network: Cache entry not found [url: http://localhost:65116/HRA_HFWv1/HTA/com/mindfusion/diagramming/DiagramApplet.cl..., version: null]
network: Connecting http://localhost:65116/HRA_HFWv1/HTA/com/mindfusion/diagramming/DiagramApplet.cl... with proxy=DIRECT
network: Connecting http://localhost:65116/ with proxy=DIRECT
network: Cache entry not found [url: http://localhost:65116/HRA_HFWv1/HTA/com/mindfusion/diagramming/DiagramApplet/cl..., version: null]
network: Connecting http://localhost:65116/HRA_HFWv1/HTA/com/mindfusion/diagramming/DiagramApplet/cl... with proxy=DIRECT
network: Connecting http://localhost:65116/ with proxy=DIRECT
basic: load: class com/mindfusion/diagramming/DiagramApplet.class not found.
load: class com/mindfusion/diagramming/DiagramApplet.class not found.
java.lang.ClassNotFoundException: com.mindfusion.diagramming.DiagramApplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: com.mindfusion.diagramming.DiagramApplet.class
Ignored exception: java.lang.ClassNotFoundException: com.mindfusion.diagramming.DiagramApplet.class
  
Back to top
 
IP Logged
 
jagdipa
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 52
Joined: Jun 23rd, 2011
Re: Silverlight ShapeListBox not displaying anythi
Reply #9 - Jul 18th, 2011 at 2:03pm
Print Post  
Okay, it seems you need the full address for it to work, ie.
www.MySite.com/JDiagram.jar will not work.
http://www.MySite.com/JDiagram.jar will work.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Silverlight ShapeListBox not displaying anythi
Reply #10 - Jul 18th, 2011 at 2:47pm
Print Post  
Ah, of course you need the http:// part Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint