Skip to main content



      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
Eclipse UserFriend
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] by 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
Eclipse UserFriend
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
Eclipse UserFriend
>
..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
Eclipse UserFriend
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] by 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
Eclipse UserFriend
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
Eclipse UserFriend
I got it, thanks Ralf.
Previous Topic:chart tools for RAP
Next Topic:Status Handlers for RAP
Goto Forum:
  


Current Time: Tue Jul 22 18:48:16 EDT 2025

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

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

Back to the top