aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Koivuviita <jouni@jounikoivuviita.com>2012-04-18 16:01:43 +0300
committerJouni Koivuviita <jouni@jounikoivuviita.com>2012-04-18 16:01:43 +0300
commit456befbba13ba0e1fb19cb8353a7744e54a3e925 (patch)
treee19ce472ce415ff81d0eefd267ccf1a37e557f68
parent8d84994be8cdae19c5e2e22f7223614453e0ef1d (diff)
downloadvaadin-framework-456befbba13ba0e1fb19cb8353a7744e54a3e925.tar.gz
vaadin-framework-456befbba13ba0e1fb19cb8353a7744e54a3e925.zip
Fixes to BoxLayout
-rw-r--r--WebContent/VAADIN/themes/runo/orderedlayout/orderedlayout.css6
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java10
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java6
3 files changed, 16 insertions, 6 deletions
diff --git a/WebContent/VAADIN/themes/runo/orderedlayout/orderedlayout.css b/WebContent/VAADIN/themes/runo/orderedlayout/orderedlayout.css
index f70e285729..8738ac89d1 100644
--- a/WebContent/VAADIN/themes/runo/orderedlayout/orderedlayout.css
+++ b/WebContent/VAADIN/themes/runo/orderedlayout/orderedlayout.css
@@ -8,7 +8,8 @@
.v-orderedlayout-margin-right,
.v-horizontallayout-margin-right,
.v-verticallayout-margin-right,
-.v-csslayout-margin-right {
+.v-csslayout-margin-right,
+.v-boxlayout.v-margin-right {
padding-right: 18px;
}
.v-orderedlayout-margin-bottom,
@@ -21,7 +22,8 @@
.v-orderedlayout-margin-left,
.v-horizontallayout-margin-left,
.v-verticallayout-margin-left,
-.v-csslayout-margin-left {
+.v-csslayout-margin-left,
+.v-boxlayout.v-margin-left {
padding-left: 18px;
}
.v-orderedlayout-spacing-on,
diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java
index b4df5215bd..087e1a5c15 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java
@@ -11,6 +11,7 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.terminal.gwt.client.AbstractFieldState;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ConnectorHierarchyChangeEvent;
@@ -186,6 +187,12 @@ public abstract class AbstractBoxLayoutConnector extends
.getIcon().getURL() : null;
List<String> styles = child.getState().getStyles();
String error = child.getState().getErrorMessage();
+ boolean showError = error != null;
+ if (child.getState() instanceof AbstractFieldState) {
+ AbstractFieldState abstractFieldState = (AbstractFieldState) child
+ .getState();
+ showError = showError && !abstractFieldState.isHideErrors();
+ }
boolean required = false;
if (child instanceof AbstractFieldConnector) {
required = ((AbstractFieldConnector) child).isRequired();
@@ -193,7 +200,8 @@ public abstract class AbstractBoxLayoutConnector extends
boolean enabled = child.getState().isEnabled();
// TODO Description is handled from somewhere else?
- slot.setCaption(caption, iconUrl, styles, error, required, enabled);
+ slot.setCaption(caption, iconUrl, styles, error, showError, required,
+ enabled);
slot.setRelativeWidth(child.isRelativeWidth());
slot.setRelativeHeight(child.isRelativeHeight());
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java
index 29c619434f..1b06861b8a 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java
@@ -230,8 +230,8 @@ public class VBoxLayout extends FlowPanel {
// TODO refactor VCaption and use that instead: creates a tight coupling
// between this layout and Vaadin, but it's already coupled
public void setCaption(String captionText, String iconUrl,
- List<String> styles, String error, boolean required,
- boolean enabled) {
+ List<String> styles, String error, boolean showError,
+ boolean required, boolean enabled) {
// TODO place for optimization: check if any of these have changed
// since last time, and only run those changes
@@ -301,7 +301,7 @@ public class VBoxLayout extends FlowPanel {
}
// Error
- if (error != null) {
+ if (error != null && showError) {
if (errorIcon == null) {
errorIcon = DOM.createSpan();
errorIcon.setClassName("v-errorindicator");