PDA

View Full Version : Executing javascript inside a GXT "page"/component



rgalvao
3 Nov 2009, 12:11 PM
Hi,

How do I execute a javascript inside a "gxt page"?
Specifically I´m trying to integrate with a plugin
that has this javascript bridge:

http://www.unifycommunity.com/wiki/index.php?title=UnityObject

As this page says, I included this code inside my html file:


<script type="text/javascript" src="unityobject.js"></script>

And tried to integrate with the plugin puting the following code
inside a Html component´s content.


<script type="text/javascript">
var uniObj = new UnityObject("example.unity3d", "example", "640", "480", "000000", "000000");
uniObj.write();
</script>

But nothing appears. Is there another way? Am I doing
it wrong?

TIA,
R.

terciofilho
3 Nov 2009, 1:47 PM
You can create a Native Method:



public native void executeJS() /*-{
var uniObj = new UnityObject("example.unity3d", "example", "640", "480", "000000", "000000");
uniObj.write();
}-*/;

And call this method in your GWT application.

Hope this helps.