Skip to main content


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 11:18 Go to next message
David Song is currently offline David SongFriend
Messages: 217
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 14: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 08:49 Go to previous messageGo to next message
David Song is currently offline David SongFriend
Messages: 217
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 09:40 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
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 11:05 Go to previous messageGo to next message
David Song is currently offline David SongFriend
Messages: 217
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 11: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 08:07 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
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 09:19 Go to previous message
David Song is currently offline David SongFriend
Messages: 217
Registered: April 2011
Senior Member
I got it, thanks Ralf.
Previous Topic:chart tools for RAP
Next Topic:Status Handlers for RAP
Goto Forum:
  


Current Time: Thu Apr 25 12:36:55 GMT 2024

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

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

Back to the top