diff --git a/modules/web-toolkit/src/com/haulmont/cuba/web/toolkit/ui/client/button/CubaButtonWidget.java b/modules/web-toolkit/src/com/haulmont/cuba/web/toolkit/ui/client/button/CubaButtonWidget.java index 6c1543b63b..c17cb1f8cc 100644 --- a/modules/web-toolkit/src/com/haulmont/cuba/web/toolkit/ui/client/button/CubaButtonWidget.java +++ b/modules/web-toolkit/src/com/haulmont/cuba/web/toolkit/ui/client/button/CubaButtonWidget.java @@ -18,6 +18,10 @@ import com.vaadin.client.ui.VButton; */ public class CubaButtonWidget extends VButton { + public CubaButtonWidget() { + addStyleDependentName("empty-caption"); + } + @Override public void onClick(ClickEvent event) { if (BrowserInfo.get().isIE() && BrowserInfo.get().getIEVersion() >= 11) { @@ -28,6 +32,17 @@ public class CubaButtonWidget extends VButton { super.onClick(event); } + @Override + public void setText(String text) { + if (text == null || "".equals(text)) { + addStyleDependentName("empty-caption"); + } else { + removeStyleDependentName("empty-caption"); + } + + super.setText(text); + } + @Override protected boolean handleKeyboardEvents(Event event) { int type = DOM.eventGetType(event);