Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349671 - ProgressListener.completed() no more called
Summary: ProgressListener.completed() no more called
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.5 M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: sr141
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-17 06:43 EDT by Dominik G. CLA
Modified: 2011-08-25 08:45 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch for 1.4 SR1 (2.12 KB, patch)
2011-06-17 08:41 EDT, Ivan Furnadjiev CLA
ivan: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik G. CLA 2011-06-17 06:43:39 EDT
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.
Comment 1 Ivan Furnadjiev CLA 2011-06-17 07:41:45 EDT
Reproducible with Controls Demo -> Browser Tab with CVS HEAD.
Comment 2 Ivan Furnadjiev CLA 2011-06-17 08:41:03 EDT
Created attachment 198175 [details]
Proposed patch for 1.4 SR1
Comment 3 Ivan Furnadjiev CLA 2011-06-17 08:42:25 EDT
Patch is applied to CVS HEAD. JS test added.
Comment 4 Ivan Furnadjiev CLA 2011-06-17 08:44:39 EDT
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.
Comment 5 Ivan Furnadjiev CLA 2011-07-26 04:01:34 EDT
Applied patch to v1.4_Maintenance branch.
Comment 6 Tim Buschtoens CLA 2011-08-25 08:45:57 EDT
Commited patch to v14_Tree_Table_Merge branch