Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2016-11-02 09:47:39 +0000
committerGerrit Code Review @ Eclipse.org2016-11-02 13:40:26 +0000
commit89b34a07087b0b2b436330a42252a2141edb9a60 (patch)
treef89143919e7e705339f41a42c47a24365c5872c3 /bundles
parentf419a53ff0dec4685852b20e9f4338ff4a9cfed9 (diff)
downloadorg.eclipse.rap-89b34a07087b0b2b436330a42252a2141edb9a60.tar.gz
org.eclipse.rap-89b34a07087b0b2b436330a42252a2141edb9a60.tar.xz
org.eclipse.rap-89b34a07087b0b2b436330a42252a2141edb9a60.zip
Fix duplicate requests when setting Browser URL with widget creation
When Browser URL is set in the same request where widget is created, it's applyed twice on the underlying iframe - once in Iframe.js#_applyElement and once in a timeout in BrowserHandler.js#url property handler. This leads to duplicate requests to this URL. Sync the source manually only if browser widget is already created. 497483: Browser.setUrl() produces duplicate GET request https://bugs.eclipse.org/bugs/show_bug.cgi?id=497483 Change-Id: I3967d76e96560dc5cdbb901876bd0828dda1b103
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/remote/handler/BrowserHandler.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/remote/handler/BrowserHandler.js b/bundles/org.eclipse.rap.rwt/js/rwt/remote/handler/BrowserHandler.js
index b253acf7bf..955cf139b9 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/remote/handler/BrowserHandler.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/remote/handler/BrowserHandler.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 EclipseSource and others.
+ * Copyright (c) 2011, 2016 EclipseSource and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,9 +31,11 @@ rwt.remote.HandlerRegistry.add( "rwt.widgets.Browser", {
propertyHandler : rwt.remote.HandlerUtil.extendControlPropertyHandler( {
"url" : function( widget, value ) {
widget.setSource( value );
- setTimeout( function() { // Delay syncSource, see Bug 474141
- widget.syncSource();
- }, 0 );
+ if( widget.isCreated() ) {
+ setTimeout( function() { // Delay syncSource, see Bug 474141
+ widget.syncSource();
+ }, 0 );
+ }
},
"functionResult" : function( widget, value ) {
widget.setFunctionResult( value[ 0 ], value[ 1 ], value[ 2 ] );

Back to the top