Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » help for custom widget resourse file path in js?
help for custom widget resourse file path in js? [message #764998] Tue, 13 December 2011 08:36 Go to next message
David Song is currently offline David SongFriend
Messages: 217
Registered: April 2011
Senior Member
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 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
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 #765025 is a reply to message #765009] Tue, 13 December 2011 09:34 Go to previous messageGo to next message
David Song is currently offline David SongFriend
Messages: 217
Registered: April 2011
Senior Member
Thank you Ivan, would you please explain much more detail or give some code?
Re: help for custom widget resourse file path in js? [message #765027 is a reply to message #765009] Tue, 13 December 2011 09:34 Go to previous messageGo to next message
David Song is currently offline David SongFriend
Messages: 217
Registered: April 2011
Senior Member
Thank you Ivan, would you please explain much more detail or give some code?
Re: help for custom widget resourse file path in js? [message #765040 is a reply to message #765025] Tue, 13 December 2011 10:04 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
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?
Re: help for custom widget resourse file path in js? [message #765060 is a reply to message #765040] Tue, 13 December 2011 10:41 Go to previous message
David Song is currently offline David SongFriend
Messages: 217
Registered: April 2011
Senior Member
thank Ivan, I did register the your first way but the path was wrong, it works.
Re: help for custom widget resourse file path in js? [message #765062 is a reply to message #765040] Tue, 13 December 2011 10:41 Go to previous message
David Song is currently offline David SongFriend
Messages: 217
Registered: April 2011
Senior Member
thank Ivan, I did register the your first way but the path was wrong, it works.
Previous Topic:help for custom widget resourse file path in js?
Next Topic:Self Hosted P2 in RAP
Goto Forum:
  


Current Time: Tue Apr 16 21:19:31 GMT 2024

Powered by FUDForum. Page generated in 1.73095 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top