.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,
.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,
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;
.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();
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());
// 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
}
// Error
- if (error != null) {
+ if (error != null && showError) {
if (errorIcon == null) {
errorIcon = DOM.createSpan();
errorIcon.setClassName("v-errorindicator");