Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 201982 - Javascript error on IE7: 'this.getTopLevelWidget()' is null
Summary: Javascript error on IE7: 'this.getTopLevelWidget()' is null
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.0   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: RC1   Edit
Assignee: Rüdiger Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-01 13:00 EDT by Roberto Sanchez CLA
Modified: 2007-09-03 12:02 EDT (History)
1 user (show)

See Also:


Attachments
Error page shown to user (504.31 KB, text/html)
2007-09-01 13:00 EDT, Roberto Sanchez CLA
no flags Details
Workaround that solves the problem (3.79 KB, text/plain)
2007-09-03 05:07 EDT, Rüdiger Herrmann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Sanchez CLA 2007-09-01 13:00:01 EDT
Created attachment 77532 [details]
Error page shown to user

Build ID: I20070601-1539

Steps To Reproduce:
It's difficult to explain how to reproduce it, It only happens in IExplorer7, in Firefox there is no problem.

On screen appears:

Could not evaluate javascript response:

'this.getTopLevelWidget()' is null or It is not an object

org.eclipse.swt.EventUtil.suspendEv...

And an Error dialog with this error is shown:

Line: 40
Character: 1740
Error: 'handler' is null or isn't an object.



This error appears when index.html is loaded, *but not always*, I'm working to get a little code snippet to reproduce the problem, but I need more time, It's not easy.





More information:
Demo app works fine.

Of course, I'm using the latest CVS version, I think that the problem is caused by something updated today (Saturday) or yesterday, when I got more info I'll post it here.

Thanks in advance.
Roberto.
Comment 1 Roberto Sanchez CLA 2007-09-01 15:48:58 EDT
Hi, I got more info, this problem happens when I try to entry in my application with [Enter] key instead of clicking over [OK] button in Login Dialog.

I have a LoginDialog that appears before Workbench, when I login into application then I close Login dialog and launch Workbench, if login fails then I show a MessageDialog to user in this case all works fine.

If I "send" data clicking over [OK] Button the Workbench is loaded successfully but  If I press [Enter] after user/password are typed then appears the Javascript problem.

[OK] Button is setted as default shell button.

In firefox works fine.

I think that this problem is old, but now the problem is more obvious due to new Error management on client-side.

I'll try to get a snippet to reproduce it.

Cheers.
Roberto.
Comment 2 Roberto Sanchez CLA 2007-09-01 16:03:07 EDT
A little more info:

It only fails if I press [Enter] from password text field, If a press it from user text box or in other control on dialog then all works.

All this info has no sense for me, I hope that you can see beyond.

Ciao.
Comment 3 Roberto Sanchez CLA 2007-09-02 05:10:23 EDT
Hi friends, more info, I hope that this could be definitive.

The problem happens when password text box is disposed, but only if event is fired  pressing [Enter] when own password field is edited. 


An Entrypoint to reproduce it:

public class EntryPointTest implements IEntryPoint {

	public Text userName = null;
	public Text userPassword = null;
	
	public Display createUI() {
		
		Display d = new Display();
		Shell shell = new Shell( d, SWT.NONE | SWT.TITLE );
		
		shell.setSize(new Point(350, 200));
		shell.setLocation(300, 300);
		shell.setText("Javascript error in Internet Explorer 7");
		shell.setBackground( Graphics.getColor(250, 222, 150));
		
		shell.setLayout(new RowLayout(SWT.VERTICAL));

		Label info = new Label(shell, SWT.NONE);
		info.setText("Set user and password, then press [Enter] from password field");
		
		Group datos = new Group(shell, SWT.NONE);
		datos.setText("Login");


		GridLayout gridLayout2 = new GridLayout(2, false);
		datos.setLayout(gridLayout2);

		Label userNameLabel = new Label(datos, SWT.NONE);
		userNameLabel.setText("User:");
		userName = new Text(datos, SWT.BORDER | SWT.SINGLE);
		userName.setTextLimit(40); 		
		userName.forceFocus();
		GridDataFactory.swtDefaults().applyTo(userName);

		Label userPasswordLabel = new Label(datos, SWT.NONE);
		userPasswordLabel.setText("Password:");
		userPassword = new Text(datos, SWT.PASSWORD | SWT.BORDER| SWT.SINGLE );
		userPassword.setTextLimit(20);
		GridDataFactory.swtDefaults().applyTo(userPassword);
	
				
		Composite comp = new Composite(shell, SWT.NONE);

		comp.setLayout(new FillLayout());
		
		final Button loginButton = new Button( comp, SWT.PUSH | SWT.FLAT);
		loginButton.setText( "Default Button" );
		loginButton.getShell().setDefaultButton( loginButton );
		
		loginButton.addSelectionListener( new SelectionAdapter() {
			public void widgetSelected( final SelectionEvent event ) {

				
				EntryPointTest.this.userPassword.dispose();
				if (!EntryPointTest.this.userPassword.isFocusControl()) {
					MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Info", "No focus over password field then nothing happens, please refresh page manually.");
				}
			}
		});


		
		shell.layout();
		shell.open();
		
		
		return d;

	}


}
Comment 4 Rüdiger Herrmann CLA 2007-09-03 03:08:22 EDT
Thanks for the hint and sorry for the inconvenience.
From what it looks like this is a qooxdoo bug that we applied a workaround for SINGLE text some days ago. Client-side SINGLE, MULTI and PASSWORD text are implemented differently.
I will try to apply the same workaround for PASSWORD and MULTI text.
Comment 5 Rüdiger Herrmann CLA 2007-09-03 05:07:21 EDT
Created attachment 77576 [details]
Workaround that solves the problem

Attached a patch beforehand, changes will be committed to CVS this evening.
Comment 6 Roberto Sanchez CLA 2007-09-03 05:20:56 EDT
Thank you Rüdiger for your quick answer, the patch works fine for me.

Ciao.
Roberto.
Comment 7 Rüdiger Herrmann CLA 2007-09-03 12:02:20 EDT
Fixed in CVS HEAD