summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorTeppo Kurki <teppo.kurki@vaadin.com>2015-05-29 13:53:56 +0300
committerTeppo Kurki <teppo.kurki@vaadin.com>2015-05-29 13:53:56 +0300
commitcf563c053fdf0d6b2991eba98e1cc118a8e74e54 (patch)
tree19967fa9b26d25409f8f52ee459ad82967d79aa1 /client
parent11d95f2a97f4ffc4ded3421952ab2f57683679b4 (diff)
downloadvaadin-framework-cf563c053fdf0d6b2991eba98e1cc118a8e74e54.tar.gz
vaadin-framework-cf563c053fdf0d6b2991eba98e1cc118a8e74e54.zip
Unbuffered editor hides notification area if no error msg present.
Change-Id: I2441d684baeb9dc48ffad845a097c6cce51a9436
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/widgets/Grid.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java
index 037131bec8..cc37074259 100644
--- a/client/src/com/vaadin/client/widgets/Grid.java
+++ b/client/src/com/vaadin/client/widgets/Grid.java
@@ -41,6 +41,7 @@ import com.google.gwt.dom.client.EventTarget;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.Node;
import com.google.gwt.dom.client.Style;
+import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.dom.client.TableCellElement;
import com.google.gwt.dom.client.TableRowElement;
@@ -1261,6 +1262,10 @@ public class Grid<T> extends ResizeComposite implements
messageWrapper.appendChild(message);
}
}
+ // In unbuffered mode only show message wrapper if there is an error
+ if (!isBuffered()) {
+ setMessageAndButtonsWrapperVisible(errorMessage != null);
+ }
}
public int getRow() {
@@ -1526,6 +1531,8 @@ public class Grid<T> extends ResizeComposite implements
attachWidget(cancelButton, buttonsWrapper);
}
+ setMessageAndButtonsWrapperVisible(isBuffered());
+
updateHorizontalScrollPosition();
AbstractRowContainer body = (AbstractRowContainer) grid
@@ -1768,11 +1775,20 @@ public class Grid<T> extends ResizeComposite implements
public void setBuffered(boolean buffered) {
this.buffered = buffered;
+ setMessageAndButtonsWrapperVisible(buffered);
}
public boolean isBuffered() {
return buffered;
}
+
+ private void setMessageAndButtonsWrapperVisible(boolean visible) {
+ if (visible) {
+ messageAndButtonsWrapper.getStyle().clearDisplay();
+ } else {
+ messageAndButtonsWrapper.getStyle().setDisplay(Display.NONE);
+ }
+ }
}
public static abstract class AbstractGridKeyEvent<HANDLER extends AbstractGridKeyEventHandler>