silverlight integration

Has anyone done any work Silverlight integration into NJX? I am looking at the following scenario:

Use a Silverlight control in NJX to display Microsoft Office documents (docs are stored in Sharepoint).

Currently I have a SUBPAGE and pass the document location URL to the SUBPAGE control. The solution works ok, but in my use case, I do not want/need the user to edit the document.

There are some minor things with using the SUBPAGE. At first the Word document would not open and I found out that our site security setting were set to ask the user if they really wanted to open the file. Once I set the default to always open these kind of files (.doc) the document opened ok.

There are probably a number of different ways to do the same thing, so if anyone has an idea I would love to hear from you.


Hi Demos,

Regarding Silverlight: Technically it is possible to integrate silverlight controls. We experimented with silverlight some time ago.

What you have to do is:

  1. add an MSSILVERLIGHT control to your PAGE layout. You’ll find it in th e “Advanced tab”.

  1. For instance place the .xaml code of your control in a subfolder myproject/xaml/mycontrol.xaml
  2. Write a small custom control (JavaScript) to load the silverlight control. For writing custom controls please check the Application Designer documentation.
    Here is some code snippet for the handler to help you get started:

public class MYCONTROLHandler implements ITagHandler
    public void generateJavaScriptForInit(int id,
                                          String tagName,
                                          StringBuffer sb)
        sb.append("if (firstusage) C_"+id+" = document.getElementById('C"+id+"');\n");
        sb.append("if (firstusage) createMySilverlightControl('myproject/xaml/mycontrol.xaml',C_"+id+",'"+id+"','"+"400"+"','"+"200"+"');\n");

The Java Script method createMySilverlightControl is implemented in the Java Script libraries, which ship with NJX.

For integrating controls without nearly any interactions with the other controls on a page or with Natural, this might already do the trick. However for a “real integration” with the page data and the Natural data this is not enough. This would require more support and especially documentation how to do it from our side (= Product Enhancement). If this is an important feature for you, you might want to add an enhancement request.

Best Regards,