Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Different errors occurs in firefox and chrome when I close my custom widget
Different errors occurs in firefox and chrome when I close my custom widget [message #1044809] Fri, 19 April 2013 07:18 Go to next message
Song David is currently offline Song David
Messages: 187
Registered: April 2011
Senior Member
Hi all,
I wrote a chart custom widget with RAP 2.0 feature, and it can be displayed in my RAP 2.0 project, but once I close the dialog or editor which the custom widget layouts in, different errors occur in different browsers. And the error code is just like below,

in Firefox:
Could not process server response:

Error: TypeError: this._clientArea is null

...


in Chrome:
Could not process server response:

Error: TypeError: Cannot call method 'concat' of null


Thank you very much

David

[Updated on: Fri, 19 April 2013 10:21]

Report message to a moderator

Re: Different errors occurs in firefox and chrome when I close my custom widget [message #1045447 is a reply to message #1044809] Sat, 20 April 2013 04:49 Go to previous messageGo to next message
Song David is currently offline Song David
Messages: 187
Registered: April 2011
Senior Member
this.parent.getClientAera()caused errors, it is ok after I get rid of it.
layout : function() {
     var area = this.parent.getClientArea();
     this.element.style.left = area[0] + "px";
     this.element.style.top = area[1] + "px";
}
Re: Error occurs when I close my custom widget [message #1045473 is a reply to message #1044809] Sat, 20 April 2013 05:40 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1290
Registered: July 2009
Senior Member

>
..members.getClientArea@http://localhost:10080/rwt-resources/rap-client.js:61598

>
> @http://localhost:10080/rwt-resources/rap-client.js:71198
> jschart.JChart.prototype.layout@http://localhost:10080/fms:51

It seems that you try to layout your widget after it has been disposed.
I guess either you or the framework should unbind a listener. How does
the code around /fms, line 51 look like?

Regards, Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Error occurs when I close my custom widget [message #1045506 is a reply to message #1045473] Sat, 20 April 2013 07:05 Go to previous messageGo to next message
Song David is currently offline Song David
Messages: 187
Registered: April 2011
Senior Member
Thanks Ralf for your help.
After I remove the code below, the chart widget can work well, but it give a error backgroud Invalid negative value for <rect> attribute width="-1" ,
probably the widget's rect is not set without the code below. but it works well.

var area = this.parent.getClientArea();
this.element.style.left = area[0] + "px";
this.element.style.top = area[1] + "px";


the code around /fms, line 51 is the layout function

layout : function() {
   var area = this.parent.getClientArea();
   this.element.style.left = area[0] + "px";
   this.element.style.top = area[1] + "px";
   if (!this.isRendered) {
        this.chart.setJSONData(this._chartData);
	this.chart.render(this.element.id)
   }
   this.chart.resizeTo( area[2], area[3] );
}

[Updated on: Sat, 20 April 2013 07:16]

Report message to a moderator

Re: Error occurs when I close my custom widget [message #1046673 is a reply to message #1045506] Mon, 22 April 2013 04:07 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1290
Registered: July 2009
Senior Member

The interesting part is where this layout function is bound, either to
the global rap object or to parent resize.

If it's bound to the global rap object, then it must be unbound on dispose.

Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Error occurs when I close my custom widget [message #1046720 is a reply to message #1046673] Mon, 22 April 2013 05:19 Go to previous message
Song David is currently offline Song David
Messages: 187
Registered: April 2011
Senior Member
I got it, thanks Ralf.
Previous Topic:Browser Context Menu and Selectable Content
Next Topic:view toolbar display problem on business theme
Goto Forum:
  


Current Time: Wed Aug 20 06:51:38 EDT 2014

Powered by FUDForum. Page generated in 0.02360 seconds