help for custom widget resourse file path in js? [message #764998] |
Tue, 13 December 2011 08:36  |
Eclipse User |
|
|
|
hi all,
I will write a custom widget to display chart with open flash chart. but I get in trouble in the path of flash swf file path in JS code.
var swf = '<object width="100%" height="100%">'+
'<param value="open-flash-chart.swf" name="movie"></param>'+
'<embed src="copen-flash-chart.swf" width="100%" height="100%"'+
' type="application/x-shockwave-flash">'+
'</embed></object>';
document.getElementById(this._id).innerHTML = swf;
it doesn't work. how to express the path of swf file?
Thank you a lot;
David
|
|
|
Re: help for custom widget resourse file path in js? [message #765009 is a reply to message #764998] |
Tue, 13 December 2011 08:52   |
Eclipse User |
|
|
|
Hi,
you have to register the swf file on the server and pass the real path
(IResourceManager#getLocation(String)) to the client.
HTH,
Ivan
On 12/13/2011 10:36 AM, micromms wrote:
> hi all,
> I will write a custom widget to display chart with open flash chart.
> but I get in trouble in the path of flash swf file path in JS code.
>
>
> var swf = '<object width="100%" height="100%">'+
> '<param value="open-flash-chart.swf" name="movie"></param>'+
> '<embed src="copen-flash-chart.swf" width="100%" height="100%"'+
> ' type="application/x-shockwave-flash">'+
> '</embed></object>';
> document.getElementById(this._id).innerHTML = swf;
>
>
> it doesn't work. how to express the path of swf file?
> Thank you a lot;
>
> David
|
|
|
|
|
Re: help for custom widget resourse file path in js? [message #765040 is a reply to message #765025] |
Tue, 13 December 2011 10:04   |
Eclipse User |
|
|
|
You could do it in two different ways:
1. Use the "org.eclipse.equinox.http.registry.resources" extension point.
<extension
point="org.eclipse.equinox.http.registry.resources">
<resource
alias="/swf/copen-flash-chart.swf"
base-name="/swf/copen-flash-chart.swf">
</resource>
</extension>
or:
1. Use RWT.getResourceManager() to obtain the resource manager instance.
2. Use one of the IResourceManager#register methods to register the swf
file.
3. In the custom widget LCA get the location of the registered file with
IResourceManager#getLocation and pass it to the client
HTH,
Ivan
On 12/13/2011 11:34 AM, micromms wrote:
> Thank you Ivan, would you please explain much more detail or give some
> code?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03885 seconds