aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/src/com/vaadin/client/connectors/GridConnector.java5
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/GridState.java1
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/InitialFrozenColumns.java41
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/InitialFrozenColumnsTest.java40
4 files changed, 86 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/connectors/GridConnector.java b/client/src/com/vaadin/client/connectors/GridConnector.java
index 556a5ad7aa..af5affde08 100644
--- a/client/src/com/vaadin/client/connectors/GridConnector.java
+++ b/client/src/com/vaadin/client/connectors/GridConnector.java
@@ -471,6 +471,11 @@ public class GridConnector extends AbstractHasComponentsConnector implements
getState().editorRowEnabled);
}
+ if (stateChangeEvent.hasPropertyChanged("frozenColumnCount")) {
+ getWidget().setFrozenColumnCount(
+ getState().frozenColumnCount);
+ }
+
}
});
diff --git a/shared/src/com/vaadin/shared/ui/grid/GridState.java b/shared/src/com/vaadin/shared/ui/grid/GridState.java
index c30ebae474..aae4005d7f 100644
--- a/shared/src/com/vaadin/shared/ui/grid/GridState.java
+++ b/shared/src/com/vaadin/shared/ui/grid/GridState.java
@@ -116,7 +116,6 @@ public class GridState extends AbstractComponentState {
public GridStaticSectionState footer = new GridStaticSectionState();
/** The number of frozen columns */
- @DelegateToWidget
public int frozenColumnCount = 0;
/** The height of the Grid in terms of body rows. */
diff --git a/uitest/src/com/vaadin/tests/components/grid/InitialFrozenColumns.java b/uitest/src/com/vaadin/tests/components/grid/InitialFrozenColumns.java
new file mode 100644
index 0000000000..b6da30d314
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/InitialFrozenColumns.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.grid;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Grid;
+import com.vaadin.ui.Grid.SelectionMode;
+
+public class InitialFrozenColumns extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Grid grid = new Grid();
+ grid.setSelectionMode(SelectionMode.NONE);
+
+ grid.addColumn("foo").setWidth(200);
+ grid.addColumn("bar").setWidth(200);
+ grid.addColumn("baz").setWidth(200);
+
+ grid.addRow("a", "b", "c");
+
+ grid.setFrozenColumnCount(2);
+
+ addComponent(grid);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/grid/InitialFrozenColumnsTest.java b/uitest/src/com/vaadin/tests/components/grid/InitialFrozenColumnsTest.java
new file mode 100644
index 0000000000..2e5fc4815e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/InitialFrozenColumnsTest.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.tests.components.grid;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.NotificationElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class InitialFrozenColumnsTest extends MultiBrowserTest {
+ @Test
+ public void testInitialFrozenColumns() {
+ setDebug(true);
+ openTestURL();
+
+ Assert.assertFalse("Notification was present",
+ isElementPresent(NotificationElement.class));
+
+ WebElement cell = $(GridElement.class).first().getCell(0, 0);
+ assertTrue(cell.getAttribute("class").contains("frozen"));
+ }
+}