As a comparative newbie, this might be a very silly question but here goes …
Is it possible to view Flash or Silverlight files within a web client. I have looked at ‘html area’ fields and html labels with no luck. Is this possible with Servoy, out of the box or with an add-on of some sort?
If so, I am wishing to create a swf which can be clicked on to generate some data which can be posted into Servoy. I’m not sure this is possible either?
Thanks Johan…I seem to be getting somewhere in that I can now render a Silverlight file from within the web client. However it keeps disappearing when I restart the web client. It appears to be something quirky with the url. Here is my code:
When the file disappears, I change the url to ‘…/…/silverlight_file.xap’. and it appears temporarily, disappears, then appears when I change the url back. I reset the browser and databaseManager.saveData () before each test.
because you are filling there something really relative that is not going to work becaue the browser then makes it different depending how you start the solutution (arguments etc)
I have tried this method and also absolute paths without success. They work for a moment. I am also told that the embedding is different for each browser. I will look into this further and come back with my findings.
I’m getting there. I now have my SIlverLight object rendering in the web client. The object sits in an html field and has a button which I would like to call a Servoy method.
Now I know I can trigger a method (from the SilverLight object) in the HTML area if I do this…
From SilverLight call a JS method defined in the browser page that calls the onClick event on a bla like this: document.getElementById(‘bla’).onclick();
Here is an example of HTML Area content you could use to play with these possibilities:
<html>
<body>
<a href="http://localhost:8080/servoy-webclient/solutions/solution/nameOfYourSolution/method/nameOfYourGlobalMethod/argument/0">button</a>
 
<a id="bla" href="javascript:globals.nameOfYourGlobalMethod()">button</a>
 
<a onClick="document.getElementById('bla').onclick();" href="#">This simulates what you must do with the JS triggered from SilverLight</a>
</body>
</html>
Not sure I follow?
The Silverlight object is passing the Servoy method an array of VARIABLE length. I am stuck as to pass this array to the Servoy method. I have watched the debugger and nothing seems to get passed by my method.
<script>
function triggeredBySLight()
{
for (i = 0; i < arguments.length; i++)
{
document.getElementById("servoy").click(i); *** DO I PUT MY ARGUMENTS HERE***
}
}
</script>
<a id="servoy" href="http://localhost:8080/servoy-webclient/solutions/solution/solutionName/method/ServoyMethod/argument/0"></a> ***OR HERE***
<object data="data:application/x-silverlight,"; type="application/x-silverlight-2" width="100%" height="100%"><param name="source" value="../../../servoy-webclient/silverlightObject.xap"/></object>
The argument is specified in the URL. (In your case “0” is the argument)
http://localhost:8080/servoy-webclient/solutions/solution/solutionName/method/ServoyMethod/argument/***THIS IS WHERE YOU PUT THE ARGUMENT***
Can’t you construct the URL inside Silverlight and open it from there (I didn’t work in silverlight, so just asking)? (then you no longer need JS any more…)
This thread has been dead for over a year. I am curious if anyone was ever able to integrate Silverlight into a Servoy Smart Client and/or Servoy Web Client solution. If you have been successful, would you mind contacting me or posting some additional information on this thread?
You can easily host silverlight from Servoy by dropping the necessary files into the webapps directory. The one change is that with tomcat you need to change the extension ```
``` to ```
"
``` to get silverlight to work.
This allows you to work with silverlight via headless or web client pretty easily.
For triggering servoy methods from within silverlight I would probably replace the technique outlined above (though it looks like it would work fine too) with Sean Devlin’s client-side plugin (which we have found quite effective with integrating with jquery) due to the fact that silverlight has a well defined javascript integration api:
To finish the round trip up sending data to the silver light app can be done via the usual silverlight data interfaces.
That’s my top level thoughts. The exact code implementation steps are a bit different depending on if you’re running headless or web client and how extensive your integration goals are. I would hesitate to do a full UI interface with silverlight this way (data broadcasting just one potentially significant coding task) but not much work to include silverlight widget type stuff.
I acheived this in the end much the same way as David suggested.
The trick was to place the silverlight.xap object in the servoy/application_server/server/webapps folder.
I called it using:
<html><script>function silverlightobject(){for (i = 0; i < arguments.length; i++) {document.getElementById("servoy").click();}}</script><a id="servoy" href="http://localhost:8080/servoy-webclient/solutions/solution/evaluate/method/<<methodNameInsideSilverlight>>/argument/0"></a><object data="data:application/x-silverlight,"; type="application/x-silverlight-2" width="100%" height="100%"><param name="source" value="../../../servoy-webclient/<<silverlightObject.xap>>"/></object></html>';
The methodNameInsideSilverlight sends parameters to a method within the Servoy form which delivers the result I was after. Not sure it is the most eloquent way, but it works.