Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null
RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385131] Wed, 04 June 2014 13:55 Go to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 235
Registered: March 2010
Location: France
Senior Member
Hello,
since RAP 2.3.0 RC2, sometimes, the client crash with error above.

I am currently trying to provide a snippet reproducing the issue, I let you know as soon as I have found

Error: TypeError: Cannot read property 'getFocusedChild' of null

stack: TypeError: Cannot read property 'getFocusedChild' of null
at hasFocus (http://127.0.0.1:10080/rwt-resources/rap-client.js:72446:65)
at Object.checkFocus (http://127.0.0.1:10080/rwt-resources/rap-client.js:72364:10)
at rwt.qx.Class.define.members._dispatchEvent (http://127.0.0.1:10080/rwt-resources/rap-client.js:4230:18)
at rwt.qx.Class.define.members.dispatchEvent (http://127.0.0.1:10080/rwt-resources/rap-client.js:4171:12)
at rwt.qx.Class.define.members._oninterval (http://127.0.0.1:10080/rwt-resources/rap-client.js:4863:16)
at wrap (http://127.0.0.1:10080/rwt-resources/rap-client.js:3751:25)
Stack: TypeError: Cannot read property 'getFocusedChild' of null
at hasFocus (http://127.0.0.1:10080/rwt-resources/rap-client.js:72446:65)
at Object.checkFocus (http://127.0.0.1:10080/rwt-resources/rap-client.js:72364:10)
at rwt.qx.Class.define.members._dispatchEvent (http://127.0.0.1:10080/rwt-resources/rap-client.js:4230:18)
at rwt.qx.Class.define.members.dispatchEvent (http://127.0.0.1:10080/rwt-resources/rap-client.js:4171:12)
at rwt.qx.Class.define.members._oninterval (http://127.0.0.1:10080/rwt-resources/rap-client.js:4863:16)
at wrap (http://127.0.0.1:10080/rwt-resources/rap-client.js:3751:25)
Debug: on
Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385139 is a reply to message #1385131] Wed, 04 June 2014 14:13 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Arnaud,
the stack trace does not help. We need a snippet to reproduce the issue.
Best,
Ivan

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385179 is a reply to message #1385139] Wed, 04 June 2014 19:15 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 235
Registered: March 2010
Location: France
Senior Member
I am not yet able to provide a snippet currently, but I am still working on it. The only thing I can say right now is it seems to be related to rwt.widget.Combo somehow
Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385195 is a reply to message #1385179] Wed, 04 June 2014 21:35 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Arnaud,
can you recognize this scenario:
1. Have a Combo in a Dialog
2. Combo list is opened
3. Close the dialog when Combo list is still visible - app crashed with
the stack above??!!
Best,
Ivan

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385256 is a reply to message #1385195] Thu, 05 June 2014 08:39 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 235
Registered: March 2010
Location: France
Senior Member
No in my scenario I have an editor with multiple widget, that can be disposed and created again dynamically in the same editor instance.
This error occurs only if I have a combo disposed on the editor, when the editor loose and takes focus again.

This error never happened if there is no combo, and always if there is one.

But I am not able to isolate what's wrong in a simple snippet currently.

[Updated on: Thu, 05 June 2014 08:40]

Report message to a moderator

Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385260 is a reply to message #1385256] Thu, 05 June 2014 08:56 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Arnaud,
I know exactly the place where the crash happens, but for a proper fix
(not to suppress the symptoms only - add null check) we need a way
(scenario) to reproduce it. Or at least to make our mind how is that
possible.
Combo is disposed when editor lose the focus? Even without a snippet,
could you describe your workflow, when the error occurs?
Best,
Ivan

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385262 is a reply to message #1385256] Thu, 05 June 2014 09:26 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
.... BTW is it reproducible in all browsers - FF, IE8-11, Chrome, Opera?
What browser are you using?
Best,
Ivan

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385280 is a reply to message #1385260] Thu, 05 June 2014 10:57 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 235
Registered: March 2010
Location: France
Senior Member
I have an editor displaying a tree, double click on this tree open another editor containing several widgets, depending of the tree element clicked.
If a tree element has already been opened, the same editor instance is reused but content is recreated, meaning previous widgets are disposed and created again.

The crash occurs when I open an editor for a given tree elements, with combo inside this editor, then switch back to the tree editor, then reopen the same element, so the combo widget is disposed and created again, the crash occurs when the editor containing the combo takes focus.

Debuging the javascript, the error occurs in 72443 of rap-client.js :

var hasFocus = function( control ) {
var root = control.getFocusRoot();
var result = control.getFocused()
|| ( control.contains && control.contains( root.getFocusedChild() ) );
return result;
};

I suspect it allows the rwt.widget.DropDown to hide itself when parent widget has lost focus (in my case Combo).

What I can see with a javascript debugger, is if I have an editor with a combo displayed this hasFocus metchod is called every time I switch from an editor to another (through "interval" event in stacktrace) even editors without Combo, and it seems to be called only when I switch editor. The crash occurs when this event is called on the disposed combo when I reopen the editor that dispose the combo.

It occurs on chrome and firefox last version for both, I have not tested on IE

Hope I am quite clear

[Updated on: Thu, 05 June 2014 11:00]

Report message to a moderator

Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385282 is a reply to message #1385280] Thu, 05 June 2014 11:33 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Arnaud,
these are exactly my findings, but I don't understand how this is
possible - "changeFocusedChild" is removed when Combo (DropDown) is
disposed. Could you post the JSON message sent by the server just before
the crash?
Thanks,
Ivan

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385301 is a reply to message #1385282] Thu, 05 June 2014 13:34 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 235
Registered: March 2010
Location: France
Senior Member
In my scenario I isolate a simpler way to reproduce the crash I just need to open my editor with a Combo. Then when I close it so the Combo is disposed, the next thing I do on the UI crash it with same error
As I cannot reproduce it with simple code, I guess I am doing something wrong in my code, but I am lost as it occurs only if I have a combo widget, as I am doing the same thing whatewer widget I have in the editor

Here the last JSON response sent by the server before an error (after closing the editor with Combo inside)

{"head":{"requestCounter":8},"operations":[["destroy","w162"],["destroy","w161"],["set","w2",{"activeControl":"w2"}],["set","w25",{"children":["w40","w26","w27"]}],["set","w40",{"visibility":true}],["set","w80",{"tabIndex":26}],["set","w50",{"tabIndex":327}],["set","w60",{"tabIndex":328}],["set","w95",{"tabIndex":333}],["set","w96",{"tabIndex":334}],["set","w97",{"tabIndex":335}],["set","w98",{"tabIndex":336}],["set","w99",{"tabIndex":337}],["set","w100",{"tabIndex":338}],["set","w101",{"tabIndex":339}],["set","w109",{"tabIndex":343}],["set","w111",{"tabIndex":643}],["set","w113",{"tabIndex":943}],["set","w115",{"tabIndex":1243}],["set","w119",{"tabIndex":1245}],["set","w125",{"tabIndex":1246}],["set","w27",{"selection":"w39"}],["set","w28",{"bounds":[89,1,1752,27],"clientArea":[0,0,1752,27]}],["set","w1",{"focusControl":"w2"}]]}

[Updated on: Thu, 05 June 2014 13:34]

Report message to a moderator

Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385308 is a reply to message #1385301] Thu, 05 June 2014 13:59 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
This leads to nowhere. Without a snippet to reproduce the issue we can't
do much.

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385326 is a reply to message #1385308] Thu, 05 June 2014 16:03 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 235
Registered: March 2010
Location: France
Senior Member
The main issue I think in my case is rwt.widgets.Combo destruct function is not called on javascript client, even on java server side, dispose is called on corresponding org.eclipse.swt.Combo.

And by the way I have same issue (destruct not called) on all of my widgets, but only Combo leads to a crash because of the focus management it is why I wrongly suspected Combo to be responsible of this

Do you have an idea on how it would be possible to have disposed control on server side not destroyed on client side ? What could prevent destruct to be called for disposed server control ?

[Updated on: Thu, 05 June 2014 16:44]

Report message to a moderator

Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385332 is a reply to message #1385326] Thu, 05 June 2014 16:51 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
We have to investigate this. When Composite is disposed on the server,
only "destroy" operation for it is rendered in the protocol JSON. All
children should be destroyed automatically on the client (without
explicit destroy protocol operation). If Combo destruct is not called on
the client, we need to find why. This is the actual problem we have to fix.

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP 2.3.0 RC2 Client error Cannot read property 'getFocusedChild' of null [message #1385370 is a reply to message #1385332] Thu, 05 June 2014 21:58 Go to previous message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 235
Registered: March 2010
Location: France
Senior Member
Yes I finally found it !!!

So the issue is located on TabFolder widget, it seems disposing TabFolder prevents destruct to be called on client for children of TabFolder.

I managed to create a sample showing the issue.
I have filled bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=436757

Previous Topic:Tooltip markup in tables
Next Topic:Using an image in body.html for a branding
Goto Forum:
  


Current Time: Tue Feb 25 06:53:31 GMT 2020

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

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

Back to the top