]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes to BoxLayout
authorJouni Koivuviita <jouni@jounikoivuviita.com>
Wed, 18 Apr 2012 13:01:43 +0000 (16:01 +0300)
committerJouni Koivuviita <jouni@jounikoivuviita.com>
Wed, 18 Apr 2012 13:01:43 +0000 (16:01 +0300)
WebContent/VAADIN/themes/runo/orderedlayout/orderedlayout.css
src/com/vaadin/terminal/gwt/client/ui/AbstractBoxLayoutConnector.java
src/com/vaadin/terminal/gwt/client/ui/VBoxLayout.java

index f70e285729edea7b8af05d84bfb12827a9c283f7..8738ac89d17656225d55730bc100d7092ad6e49a 100644 (file)
@@ -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,
index b4df5215bde091ee81e032a41be0fb3e609be1bf..087e1a5c155771dcfe85e6edd15a8af1cb297c6b 100644 (file)
@@ -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());
index 29c619434f3051be8a491434d874da183981d495..1b06861b8aca87c9024531260b5f08518061f29d 100644 (file)
@@ -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");