Home » Eclipse Projects » Remote Application Platform (RAP) » applet in Iframe fails with "w.setAddress is not a function"
applet in Iframe fails with "w.setAddress is not a function" [message #521838] |
Thu, 18 March 2010 21:12 |
Robbi Dierks Messages: 3 Registered: March 2010 |
Junior Member |
|
|
Hello!
I try to include an applet in a RAP widget through a qx.ui.embed.Iframe. I am using eclipse-jee-galileo-SR2 with RAP 1.3M5.
I started with the functional GMap demo application as described in the custom widget tutorial (org.eclipse.rap.demo.gmaps from CVS). Then I replaced the complete GMap.js with the following code:
---------8<----------------------------
qx.Class.define( "org.eclipse.rap.gmaps.GMap", {
extend: qx.ui.embed.Iframe,
construct: function( id ) {
this.base( arguments );
this.setHtmlAttribute("id", id);
this._id = id;
this.setSource("http:/"+" /java.sun.com/applets/jdk/1.4/demo/applets/TicTacToe/example 1.html ");
}
});
--------->8----------------------------
This example worked for me with RAP 1.2. But with RAP 1.3 I get the following error:
---------8<----------------------------
Could not evaluate javascript response:
TypeError: this[$1[$4]] is not a function
var req = org.eclipse.swt.Request.getInstance();req.setRequestCounter( "0" );qx.theme.manager.Meta.getInstance().setTheme( org.eclipse.swt.theme.Default );org.eclipse.swt.Request.getInstance().setTimeoutPage( "<html><head><title>Session timed out</title></head><body><p>The server session timed out.</p><p>Please click <a {HREF_URL}>here</a> to restart the session.</p></body></html>" );var wm = org.eclipse.swt.WidgetManager.getInstance();var w = wm.newWidget( "w2", "", false, "org.eclipse.swt.widgets.Shell" );w.addToDocument();w.addState( "rwt_TITLE" );w.setShowMinimize( true );w.setAllowMinimize( true );w.setShowMaximize( true );w.setAllowMaximize( true );w.setShowClose( true );w.setAllowClose( true );w.setResizable( true, true, true, true );w.initialize();w.addEventListener( "changeWidth", org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeHeight", org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft", org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop", org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 0, 300, 0, 300 );w.setTabIndex( -1 );w.setVisibility( true );w.setCaption( "GMaps Demo" );w.open();w.setActive( true );w.setMinWidth( 80 );w.setMinHeight( 23 );var w = wm.newWidget( "w3", "w2", true, "org.eclipse.rap.gmaps.GMap", '"w3"' );w.setAppearance( "composite" );w.setOverflow( "hidden" );w.setSpace( 0, 296, 19, 277 );w.setZIndex( 300 );w.setTabIndex( 1 );w.setAddress( "" );var w = wm.findWidgetById( "w2" );w.setActiveControl( wm.findWidgetById( "w3" ) );org.eclipse.swt.WidgetManager.getInstance().focus( "w3" );
----------->8----------------------------
I found a sort of solution to this problem at https://bugs.eclipse.org/bugs/show_bug.cgi?id=261355#c11, but it does not quite work for me. I added the dummy properties, so that the GMap.js is now:
---------8<----------------------------
qx.Class.define( "org.eclipse.rap.gmaps.GMap", {
extend: qx.ui.embed.Iframe,
properties : {
// Dummy property to make it works with RAP 1.3
backgroundGradient : {
check : "Array",
nullable : true,
init : null,
themeable : true
}
},
construct: function( id ) {
this.base( arguments );
this.setHtmlAttribute("id", id);
this._id = id;
this.setSource("http:/"+" /java.sun.com/applets/jdk/1.4/demo/applets/TicTacToe/example 1.html ");
}
});
--------->8----------------------------
But now I get a different error:
---------8<----------------------------
Could not evaluate javascript response:
TypeError: w.setAddress is not a function
var req = org.eclipse.swt.Request.getInstance();req.setRequestCounter( "0" );qx.theme.manager.Meta.getInstance().setTheme( org.eclipse.swt.theme.Default );org.eclipse.swt.Request.getInstance().setTimeoutPage( "<html><head><title>Session timed out</title></head><body><p>The server session timed out.</p><p>Please click <a {HREF_URL}>here</a> to restart the session.</p></body></html>" );var wm = org.eclipse.swt.WidgetManager.getInstance();var w = wm.newWidget( "w2", "", false, "org.eclipse.swt.widgets.Shell" );w.addToDocument();w.addState( "rwt_TITLE" );w.setShowMinimize( true );w.setAllowMinimize( true );w.setShowMaximize( true );w.setAllowMaximize( true );w.setShowClose( true );w.setAllowClose( true );w.setResizable( true, true, true, true );w.initialize();w.addEventListener( "changeWidth", org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeHeight", org.eclipse.swt.EventUtil.widgetResized );w.addEventListener( "changeLeft", org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener( "changeTop", org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 0, 300, 0, 300 );w.setTabIndex( -1 );w.setVisibility( true );w.setCaption( "GMaps Demo" );w.open();w.setActive( true );w.setMinWidth( 80 );w.setMinHeight( 23 );var w = wm.newWidget( "w3", "w2", true, "org.eclipse.rap.gmaps.GMap", '"w3"' );w.setAppearance( "composite" );w.setOverflow( "hidden" );w.setSpace( 0, 296, 19, 277 );w.setZIndex( 300 );w.setTabIndex( 1 );w.setAddress( "" );var w = wm.findWidgetById( "w2" );w.setActiveControl( wm.findWidgetById( "w3" ) );org.eclipse.swt.WidgetManager.getInstance().focus( "w3" );
--------->8----------------------------
Where does the call to w.setAddress come from? I have removed the call to 'map.setAddress( "Stephanienstraße 20, Karlsruhe" );' from the GMapDemo class in the custom widget help text.
And how can I correct the example above to display an applet in the Iframe?
Thanks
Robbi
|
|
|
Re: applet in Iframe fails with "w.setAddress is not a function" [message #521841 is a reply to message #521838] |
Thu, 18 March 2010 21:29 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Robbi,
take a look at GMapLCA#renderChanges method and remove this line:
writer.set( PROP_ADDRESS, JS_PROP_ADDRESS, gmap.getAddress() );
Best,
Ivan
On 03/18/2010 11:12 PM, Robbi Dierks wrote:
> Hello!
> I try to include an applet in a RAP widget through a
> qx.ui.embed.Iframe. I am using eclipse-jee-galileo-SR2 with RAP 1.3M5.
>
> I started with the functional GMap demo application as described in
> the custom widget tutorial (org.eclipse.rap.demo.gmaps from CVS). Then
> I replaced the complete GMap.js with the following code:
>
> ---------8<----------------------------
> qx.Class.define( "org.eclipse.rap.gmaps.GMap", {
> extend: qx.ui.embed.Iframe,
> construct: function( id ) {
> this.base( arguments );
> this.setHtmlAttribute("id", id);
> this._id = id;
> this.setSource("http:/"+"
> /java.sun.com/applets/jdk/1.4/demo/applets/TicTacToe/example 1.html ");
> }
> }); --------->8----------------------------
>
> This example worked for me with RAP 1.2. But with RAP 1.3 I get the
> following error:
>
> ---------8<----------------------------
> Could not evaluate javascript response:
> TypeError: this[$1[$4]] is not a function
>
> var req =
> org.eclipse.swt.Request.getInstance();req.setRequestCounter( "0"
> );qx.theme.manager.Meta.getInstance().setTheme(
> org.eclipse.swt.theme.Default
> );org.eclipse.swt.Request.getInstance().setTimeoutPage(
> "<html><head><title>Session timed out</title></head><body><p>The
> server session timed out.</p><p>Please click <a {HREF_URL}>here</a> to
> restart the session.</p></body></html>" );var wm =
> org.eclipse.swt.WidgetManager.getInstance();var w = wm.newWidget(
> "w2", "", false, "org.eclipse.swt.widgets.Shell"
> );w.addToDocument();w.addState( "rwt_TITLE" );w.setShowMinimize( true
> );w.setAllowMinimize( true );w.setShowMaximize( true
> );w.setAllowMaximize( true );w.setShowClose( true );w.setAllowClose(
> true );w.setResizable( true, true, true, true
> );w.initialize();w.addEventListener( "changeWidth",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
> "changeHeight", org.eclipse.swt.EventUtil.widgetResized
> );w.addEventListener( "changeLeft",
> org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener(
> "changeTop", org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 0,
> 300, 0, 300 );w.setTabIndex( -1 );w.setVisibility( true
> );w.setCaption( "GMaps Demo" );w.open();w.setActive( true
> );w.setMinWidth( 80 );w.setMinHeight( 23 );var w = wm.newWidget( "w3",
> "w2", true, "org.eclipse.rap.gmaps.GMap", '"w3"' );w.setAppearance(
> "composite" );w.setOverflow( "hidden" );w.setSpace( 0, 296, 19, 277
> );w.setZIndex( 300 );w.setTabIndex( 1 );w.setAddress( "" );var w =
> wm.findWidgetById( "w2" );w.setActiveControl( wm.findWidgetById( "w3"
> ) );org.eclipse.swt.WidgetManager.getInstance().focus( "w3" );
> ----------->8----------------------------
>
> I found a sort of solution to this problem at
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=261355#c11, but it does
> not quite work for me. I added the dummy properties, so that the
> GMap.js is now:
>
> ---------8<----------------------------
> qx.Class.define( "org.eclipse.rap.gmaps.GMap", {
> extend: qx.ui.embed.Iframe,
> properties : { // Dummy property to make it works with RAP 1.3
> backgroundGradient : {
> check : "Array",
> nullable : true,
> init : null,
> themeable : true
> } },
> construct: function( id ) {
> this.base( arguments );
> this.setHtmlAttribute("id", id);
> this._id = id;
> this.setSource("http:/"+"
> /java.sun.com/applets/jdk/1.4/demo/applets/TicTacToe/example 1.html ");
> }
> }); --------->8----------------------------
>
> But now I get a different error:
>
> ---------8<----------------------------
> Could not evaluate javascript response:
> TypeError: w.setAddress is not a function
>
> var req =
> org.eclipse.swt.Request.getInstance();req.setRequestCounter( "0"
> );qx.theme.manager.Meta.getInstance().setTheme(
> org.eclipse.swt.theme.Default
> );org.eclipse.swt.Request.getInstance().setTimeoutPage(
> "<html><head><title>Session timed out</title></head><body><p>The
> server session timed out.</p><p>Please click <a {HREF_URL}>here</a> to
> restart the session.</p></body></html>" );var wm =
> org.eclipse.swt.WidgetManager.getInstance();var w = wm.newWidget(
> "w2", "", false, "org.eclipse.swt.widgets.Shell"
> );w.addToDocument();w.addState( "rwt_TITLE" );w.setShowMinimize( true
> );w.setAllowMinimize( true );w.setShowMaximize( true
> );w.setAllowMaximize( true );w.setShowClose( true );w.setAllowClose(
> true );w.setResizable( true, true, true, true
> );w.initialize();w.addEventListener( "changeWidth",
> org.eclipse.swt.EventUtil.widgetResized );w.addEventListener(
> "changeHeight", org.eclipse.swt.EventUtil.widgetResized
> );w.addEventListener( "changeLeft",
> org.eclipse.swt.EventUtil.widgetMoved );w.addEventListener(
> "changeTop", org.eclipse.swt.EventUtil.widgetMoved );w.setSpace( 0,
> 300, 0, 300 );w.setTabIndex( -1 );w.setVisibility( true
> );w.setCaption( "GMaps Demo" );w.open();w.setActive( true
> );w.setMinWidth( 80 );w.setMinHeight( 23 );var w = wm.newWidget( "w3",
> "w2", true, "org.eclipse.rap.gmaps.GMap", '"w3"' );w.setAppearance(
> "composite" );w.setOverflow( "hidden" );w.setSpace( 0, 296, 19, 277
> );w.setZIndex( 300 );w.setTabIndex( 1 );w.setAddress( "" );var w =
> wm.findWidgetById( "w2" );w.setActiveControl( wm.findWidgetById( "w3"
> ) );org.eclipse.swt.WidgetManager.getInstance().focus( "w3" );
> --------->8----------------------------
>
> Where does the call to w.setAddress come from? I have removed the call
> to 'map.setAddress( "Stephanienstraße 20, Karlsruhe" );' from the
> GMapDemo class in the custom widget help text.
> And how can I correct the example above to display an applet in the
> Iframe?
>
> Thanks
> Robbi
|
|
| | |
Re: applet in Iframe fails with "w.setAddress is not a function" [message #522006 is a reply to message #521851] |
Fri, 19 March 2010 15:27 |
|
Hi Robbi,
there are a couple of SWT bugs describing problems with applets in the
SWT browser. You might want to search the Eclipse bugzilla if your issue
is already known and if not open a new bug against Platform/SWT.
Regards, Ralf
Robbi Dierks wrote:
> Update:
>
> If I run the RAP application in an external browser instead of the
> eclipse internal browser, the applet works fine. Thanks again!
>
> Because I find it more convenient to use the internal browser for
> testing, any hint about how to avoid the crash is highly appreciated.
>
> Robbi
|
|
|
Goto Forum:
Current Time: Thu Oct 10 19:42:37 GMT 2024
Powered by FUDForum. Page generated in 0.04087 seconds
|