summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>2011-12-22 12:04:10 +0000
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>2011-12-22 12:04:10 +0000
commit02daee926e0bb40bcd8a321a2a27570da5c9c928 (patch)
tree0e95ae3e0845bc0532a9e17fdd6536a5a156de58 /src
parentb046062c939ff96753cc84360767e2444784f1f4 (diff)
downloadvaadin-framework-02daee926e0bb40bcd8a321a2a27570da5c9c928.tar.gz
vaadin-framework-02daee926e0bb40bcd8a321a2a27570da5c9c928.zip
Merged changes from 6.8
svn changeset:22469/svn branch:6.8
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java12
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java18
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VWindow.java18
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java8
-rw-r--r--src/com/vaadin/ui/Window.java4
5 files changed, 41 insertions, 19 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
index fce5b4206c..a60fb808a1 100644
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
@@ -361,7 +361,7 @@ public class ApplicationConfiguration implements EntryPoint {
cmd.execute();
}
callbacks.clear();
- } else if(widgetsLoading == 0 && deferredWidgetLoader != null) {
+ } else if (widgetsLoading == 0 && deferredWidgetLoader != null) {
deferredWidgetLoader.trigger();
}
@@ -377,17 +377,17 @@ public class ApplicationConfiguration implements EntryPoint {
int communicationFree = 0;
int nextWidgetIndex = 0;
private boolean pending;
-
+
public DeferredWidgetLoader() {
schedule(5000);
}
public void trigger() {
- if(!pending) {
+ if (!pending) {
schedule(FREE_CHECK_TIMEOUT);
}
}
-
+
@Override
public void schedule(int delayMillis) {
super.schedule(delayMillis);
@@ -438,9 +438,9 @@ public class ApplicationConfiguration implements EntryPoint {
return communicationFree < FREE_LIMIT;
}
}
-
+
private static DeferredWidgetLoader deferredWidgetLoader;
-
+
public void onModuleLoad() {
// Enable IE6 Background image caching
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
index d9bd2ebff5..3120aa3cdb 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
@@ -4056,7 +4056,20 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
if (reactLastRow >= totalRows) {
reactLastRow = totalRows - 1;
}
- if (lastRendered < reactLastRow) {
+ if (lastRendered < reactFirstRow || firstRendered > reactLastRow) {
+ /*
+ * #8040 - scroll position is completely changed since the
+ * latest request, so request a new set of rows.
+ *
+ * TODO: We should probably check whether the fetched rows match
+ * the current scroll position right when they arrive, so as to
+ * not waste time rendering a set of rows that will never be
+ * visible...
+ */
+ rowRequestHandler.setReqFirstRow(reactFirstRow);
+ rowRequestHandler.setReqRows(reactLastRow - reactFirstRow + 1);
+ rowRequestHandler.deferRowFetch(1);
+ } else if (lastRendered < reactLastRow) {
// get some cache rows below visible area
rowRequestHandler.setReqFirstRow(lastRendered + 1);
rowRequestHandler.setReqRows(reactLastRow - lastRendered);
@@ -6657,8 +6670,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
if (BrowserInfo.get().isIE()) {
// IE sometimes moves focus to a clicked table cell...
Element focusedElement = Util.getIEFocusedElement();
- if (getElement().isOrHasChild(focusedElement)) {
+ if (Util.getPaintableForElement(client, getParent(), focusedElement) == this) {
// ..in that case, steal the focus back to the focus handler
+ // but not if focus is in a child component instead (#7965)
focus();
return;
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
index 9302be29df..54a151c7e7 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java
@@ -1099,9 +1099,9 @@ public class VWindow extends VOverlay implements Container,
* the browser to compute it based on the window contents.
*/
public void setHeight(String height) {
- if (!isAttached() || (height == null
- ? this.height == null
- : height.equals(this.height))) {
+ if (!isAttached()
+ || (height == null ? this.height == null : height
+ .equals(this.height))) {
return;
}
if (height == null || "".equals(height)) {
@@ -1113,17 +1113,17 @@ public class VWindow extends VOverlay implements Container,
renderSpace.setHeight(MIN_CONTENT_AREA_HEIGHT);
} else {
getElement().getStyle().setProperty("height", height);
- int contentHeight =
- getElement().getOffsetHeight() - getExtraHeight();
+ int contentHeight = getElement().getOffsetHeight()
+ - getExtraHeight();
if (contentHeight < MIN_CONTENT_AREA_HEIGHT) {
contentHeight = MIN_CONTENT_AREA_HEIGHT;
int rootHeight = contentHeight + getExtraHeight();
- getElement().getStyle().setProperty(
- "height", rootHeight + "px");
+ getElement().getStyle()
+ .setProperty("height", rootHeight + "px");
}
renderSpace.setHeight(contentHeight);
- contentPanel.getElement().getStyle().setProperty(
- "height", contentHeight + "px");
+ contentPanel.getElement().getStyle()
+ .setProperty("height", contentHeight + "px");
}
this.height = height;
updateShadowSizeAndPosition();
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index 93f130bb3b..e96f2d2b56 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -962,7 +962,13 @@ public abstract class AbstractCommunicationManager implements
Component p = (Component) it.next();
if (p.getApplication() == null) {
unregisterPaintable(p);
- idPaintableMap.remove(paintableIdMap.get(p));
+ // Take into account that some other component may have
+ // reused p's ID by now (this can happen when manually
+ // assigning IDs with setDebugId().) See #8090.
+ String pid = paintableIdMap.get(p);
+ if (idPaintableMap.get(pid) == p) {
+ idPaintableMap.remove(pid);
+ }
it.remove();
dirtyPaintables.remove(p);
}
diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java
index 566d16313c..1e0172d60f 100644
--- a/src/com/vaadin/ui/Window.java
+++ b/src/com/vaadin/ui/Window.java
@@ -1305,7 +1305,9 @@ public class Window extends Panel implements URIHandler, ParameterHandler,
*
* For a browser level window the CloseListener is fired when the browser
* level window is closed. Note that closing a browser level window does not
- * mean it will be destroyed.
+ * mean it will be destroyed. Also note that Opera does not send events like
+ * all other browsers and therefore the close listener might not be called
+ * if Opera is used.
*
* <p>
* Since Vaadin 6.5, removing windows using {@link #removeWindow(Window)}