diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2013-02-05 13:08:33 +0200 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2013-02-15 11:13:46 +0200 |
commit | f2ec1fa217fa0fe7f98b6a2b95ed075a2e874769 (patch) | |
tree | c48e1480b3571dc0824fd2bcdea67b438fe03088 /client/src | |
parent | 655a44cadffb2fc0f4d94327582c6611126be8ad (diff) | |
download | vaadin-framework-f2ec1fa217fa0fe7f98b6a2b95ed075a2e874769.tar.gz vaadin-framework-f2ec1fa217fa0fe7f98b6a2b95ed075a2e874769.zip |
Merge of first part of (#10513) to Vaadin 7.
Recalculate column widths if vertical scrollbar has been added/removed.
Change-Id: I093059b8eaad8ff9f9d87db213dec806993459d5
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/com/vaadin/client/ui/VScrollTable.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 75f5550790..75d67b82d6 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -500,7 +500,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** * Read from the "recalcWidths" -attribute. When it is true, the table will * recalculate the widths for columns - desirable in some cases. For #1983, - * marked experimental. + * marked experimental. See also variable <code>refreshContentWidths</code> + * in method {@link TableHead#updateCellsFromUIDL(UIDL)}. * <p> * For internal use only. May be removed or replaced in the future. */ @@ -570,6 +571,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** For internal use only. May be removed or replaced in the future. */ public ContextMenuDetails contextMenu = null; + private boolean hadScrollBars = false; + public VScrollTable() { setMultiSelectMode(MULTISELECT_MODE_DEFAULT); @@ -2038,6 +2041,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, Util.runWebkitOverflowAutoFix(scrollBodyPanel.getElement()); } }); + + hadScrollBars = willHaveScrollbarz; } /** @@ -2984,7 +2989,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, public void updateCellsFromUIDL(UIDL uidl) { Iterator<?> it = uidl.getChildIterator(); HashSet<String> updated = new HashSet<String>(); - boolean refreshContentWidths = false; + boolean refreshContentWidths = initializedAndAttached + && hadScrollBars != willHaveScrollbars(); while (it.hasNext()) { final UIDL col = (UIDL) it.next(); final String cid = col.getStringAttribute("cid"); |