diff options
author | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-01-12 11:17:28 +0000 |
---|---|---|
committer | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-01-12 11:17:28 +0000 |
commit | 4f6bc36661f0d07a6bafd7af3a0cd386f3ab9675 (patch) | |
tree | 196a59679668115c8df88d9d2d74c062a2442c4a /src | |
parent | d90f3ed208c5b5f8f6580afa95f8f22125361c2b (diff) | |
download | vaadin-framework-4f6bc36661f0d07a6bafd7af3a0cd386f3ab9675.tar.gz vaadin-framework-4f6bc36661f0d07a6bafd7af3a0cd386f3ab9675.zip |
Merge from 6.7
svn changeset:22607/svn branch:6.8
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/Util.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java | 35 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTextArea.java | 7 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VView.java | 8 | ||||
-rw-r--r-- | src/com/vaadin/ui/Table.java | 10 |
5 files changed, 44 insertions, 18 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index a72c9c1dc2..3dbbd22329 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -1080,6 +1080,8 @@ public class Util { VConsole.log("\t\t" + var[1] + " (" + var[2] + ")" + " : " + var[0]); } + } else { + VConsole.log("\t" + id + ": Warning: no corresponding paintable!"); } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index f1c1927b26..553934bf98 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -2292,26 +2292,17 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, * of the caption container element by the correct amount */ public void resizeCaptionContainer(int rightSpacing) { + + int captionContainerWidth = width + - colResizeWidget.getOffsetWidth() - rightSpacing; + if (BrowserInfo.get().isIE6() || td.getClassName().contains("-asc") || td.getClassName().contains("-desc")) { - /* - * Room for the sort indicator is made by subtracting the styled - * margin and width of the resizer from the width of the caption - * container. - */ - int captionContainerWidth = width - - sortIndicator.getOffsetWidth() - - colResizeWidget.getOffsetWidth() - rightSpacing; - captionContainer.getStyle().setPropertyPx("width", - captionContainerWidth); - } else { - /* - * Set the caption container element as wide as possible when - * the sorting indicator is not visible. - */ - captionContainer.getStyle().setPropertyPx("width", - width - rightSpacing); + // Leave room for the sort indicator + captionContainerWidth -= sortIndicator.getOffsetWidth(); } + captionContainer.getStyle().setPropertyPx("width", + captionContainerWidth); // Apply/Remove spacing if defined if (rightSpacing > 0) { @@ -6071,7 +6062,15 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, public void onScroll(ScrollEvent event) { scrollLeft = scrollBodyPanel.getElement().getScrollLeft(); scrollTop = scrollBodyPanel.getScrollPosition(); - if (!initializedAndAttached) { + /* + * #6970 - IE sometimes fires scroll events for a detached table. + * + * FIXME initializedAndAttached should probably be renamed - its name + * doesn't seem to reflect its semantics. onDetach() doesn't set it to + * false, and changing that might break something else, so we need to + * check isAttached() separately. + */ + if (!initializedAndAttached || !isAttached()) { return; } if (!enabled) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextArea.java b/src/com/vaadin/terminal/gwt/client/ui/VTextArea.java index a74fd9f5dc..cd09e24d67 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextArea.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextArea.java @@ -69,4 +69,11 @@ public class VTextArea extends VTextField { super.onBrowserEvent(event);
}
+ @Override
+ public int getCursorPos() {
+ // This is needed so that TextBoxImplIE6 is used to return the correct
+ // position for old Internet Explorer versions where it has to be
+ // detected in a different way.
+ return getImpl().getTextAreaCursorPos(getElement());
+ }
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index f21c0aaac0..07ade6a8b1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -591,6 +591,11 @@ public class VView extends SimplePanel implements Container, ResizeHandler, String ownAppId = connection.getConfiguration().getRootPanelId(); + // Hiding elements causes browser to forget scroll position -> must + // save values and restore when the elements are visible again #7976 + int originalScrollTop = Window.getScrollTop(); + int originalScrollLeft = Window.getScrollLeft(); + // Set display: none for all Vaadin apps for (int i = 0; i < vaadinApps.size(); i++) { String appId = vaadinApps.get(i); @@ -629,6 +634,9 @@ public class VView extends SimplePanel implements Container, ResizeHandler, } } + // Scroll back to original location + Window.scrollTo(originalScrollLeft, originalScrollTop); + return w; } diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index b7235dd37b..d8c59c2e91 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -5148,4 +5148,14 @@ public class Table extends AbstractSelect implements Action.Container, public RowGenerator getRowGenerator() { return rowGenerator; } + + @Override + public void setVisible(boolean visible) { + if (!isVisible() && visible) { + // We need to ensure that the rows are sent to the client when the + // Table is made visible if it has been rendered as invisible. + setRowCacheInvalidated(true); + } + super.setVisible(visible); + } } |