Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem when var w = wm.findWidgetById with a custom widget on IE
Problem when var w = wm.findWidgetById with a custom widget on IE [message #58275] Wed, 07 November 2007 10:06 Go to next message
Eclipse UserFriend
Originally posted by: cedric.gaillot.thalesraytheon-fr.com

Hi,

We have created a custom widget to display a cartographic map (Itself
supported by an external javascript library).

I'm able to send commands from the Java side to the Javascript side thanks
to the JSWriter class.

It works fine with fireFox but in IE, i get the following error :

Could not evaluate javascript response:

'wm' is null or is not an object

var w = wm.findWidgetById( "w45" );
w.setBaseLayer( "Blue Marble"); ---------------> MY METHOD
org.eclipse.swt.EventUtil.suspendEventHandling();
var wm = org.eclipse.swt.WidgetManager.getInstance();
var w = wm.findWidgetById( "w3" );
w.setSpace( 0, 1111, 0, 20 );
var w = wm.findWidgetById( "w50" );
w.setValue( "Blue Marble");
qx.ui.core.Widget.flushGlobalQueues();
org.eclipse.swt.EventUtil.resumeEventHandling();

Thanks for yours answers.

Cédric G.
Re: Problem when var w = wm.findWidgetById with a custom widget on IE [message #58299 is a reply to message #58275] Wed, 07 November 2007 11:41 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 237
Registered: July 2009
Senior Member
Hi Cédric,

it looks like you're too early in the lifecycle. How do you write out
the javascript stuff (means where do you use the JSWriter)?

As you see in line 4 of the response, the wm var (the widget manager) is
initialized there and is not available in line 2.
Normally this stuff should be done in renderChanges in your WidgetLCA.

Hope that helps
Benny

Cédric G. wrote:
> Hi,
>
> We have created a custom widget to display a cartographic map (Itself
> supported by an external javascript library).
> I'm able to send commands from the Java side to the Javascript side
> thanks to the JSWriter class.
>
> It works fine with fireFox but in IE, i get the following error :
>
> Could not evaluate javascript response:
>
> 'wm' is null or is not an object
>
> var w = wm.findWidgetById( "w45" );
> w.setBaseLayer( "Blue Marble"); ---------------> MY METHOD
> org.eclipse.swt.EventUtil.suspendEventHandling();
> var wm = org.eclipse.swt.WidgetManager.getInstance();
> var w = wm.findWidgetById( "w3" );
> w.setSpace( 0, 1111, 0, 20 );
> var w = wm.findWidgetById( "w50" );
> w.setValue( "Blue Marble");
> qx.ui.core.Widget.flushGlobalQueues();
> org.eclipse.swt.EventUtil.resumeEventHandling();
>
> Thanks for yours answers.
>
> Cédric G.
>
>
Re: Problem when var w = wm.findWidgetById with a custom widget on IE [message #59036 is a reply to message #58299] Fri, 09 November 2007 16:40 Go to previous message
Eclipse UserFriend
Originally posted by: cedric.gaillot.thalesraytheon-fr.com

Hi,

Indeed, I was calling JSWriter class outside from the renderChanges method
of my LCA class.

I had many JSWriter calls which were located inside the java class of my
custom widgets.

I have modified my code to regroup all theses calls inside the LCA
renderChanges and it seems to work fine again in IE.

Thanks for the help,

Cédric.
Previous Topic:RAP projects templates/example
Next Topic:Dimension of Custom Components
Goto Forum:
  


Current Time: Sun Jul 07 22:23:31 GMT 2024

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

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

Back to the top