Community
Participate
Working Groups
Build: RAP 1.4M7 - RAP 1.4RC4, v14_Maintenance If I add a ProgressListener to a Browser widget the completed() event is no more called after I call setUrl(). Here is a snippet to reproduce: public class ProgressListenerCompletedBug implements IEntryPoint { public int createUI() { Display display = new Display(); Shell shell = new Shell(display, SWT.TITLE); createContent(shell); shell.layout(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } return 0; } private void createContent(Shell shell) { shell.setLayout(new GridLayout(1, false)); Browser browser= new Browser(shell, SWT.NONE); browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); browser.addProgressListener(new ProgressListener() { public void completed(ProgressEvent event) { System.out.println("ProgressListener.completed(): " + event); //$NON-NLS-1$ } public void changed(ProgressEvent event) { System.out.println("ProgressListener.changed(): " + event); //$NON-NLS-1$ } }); browser.setUrl("http://www.google.de"); //$NON-NLS-1$ } } Results: RAP 1.4M6 ProgressListener.changed(): ProgressEvent{Browser {} data=null current=0 total=0} ProgressListener.changed(): ProgressEvent{Browser {} data=null current=0 total=0} ProgressListener.completed(): ProgressEvent{Browser {} data=null current=0 total=0} RAP 1.4M7 - RAP 1.4RC4 ProgressListener.changed(): ProgressEvent{Browser {} data=null current=0 total=0} Expected Result: ProgressListener.completed() will be called again.
Reproducible with Controls Demo -> Browser Tab with CVS HEAD.
Created attachment 198175 [details] Proposed patch for 1.4 SR1
Patch is applied to CVS HEAD. JS test added.
Just for the record - the issue was in Browser.js#_onload. The progress event was not fired if the url points to an "external" page.
Applied patch to v1.4_Maintenance branch.
Commited patch to v14_Tree_Table_Merge branch