aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorpag <gabi.antal88@gmail.com>2015-11-13 17:10:45 +0100
committerpag <gabi.antal88@gmail.com>2015-11-13 17:10:45 +0100
commit2edab81c8f280a36924cd60ca1df2181465cfcbb (patch)
treeb948f26a97323b4562f20bffe2db4b9214a44737 /client
parent8953147d96087582a7fea2c5284d585e70d768df (diff)
downloadvaadin-framework-2edab81c8f280a36924cd60ca1df2181465cfcbb.tar.gz
vaadin-framework-2edab81c8f280a36924cd60ca1df2181465cfcbb.zip
Use TabState.id for Accordion tab items as well (#18456)
Change-Id: I17206081109b2ec356d175915a16b0002a858bb4
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/VAccordion.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ui/VAccordion.java b/client/src/com/vaadin/client/ui/VAccordion.java
index fc328dd56a..afc66d0f7b 100644
--- a/client/src/com/vaadin/client/ui/VAccordion.java
+++ b/client/src/com/vaadin/client/ui/VAccordion.java
@@ -36,6 +36,7 @@ import com.vaadin.shared.ComponentConstants;
import com.vaadin.shared.ui.accordion.AccordionState;
import com.vaadin.shared.ui.tabsheet.TabState;
import com.vaadin.shared.ui.tabsheet.TabsheetServerRpc;
+import com.vaadin.shared.util.SharedUtil;
public class VAccordion extends VTabsheetBase {
@@ -79,6 +80,8 @@ public class VAccordion extends VTabsheetBase {
item.updateTabStyleName(tabState.styleName);
item.setVisible(tabState.visible);
+
+ item.setId(tabState.id);
}
@Override
@@ -160,6 +163,7 @@ public class VAccordion extends VTabsheetBase {
public class StackItem extends ComplexPanel implements ClickHandler {
private Widget widget;
+ private String id;
public void setHeight(int height) {
if (height == -1) {
@@ -172,6 +176,18 @@ public class VAccordion extends VTabsheetBase {
}
}
+ public void setId(String newId) {
+ if (!SharedUtil.equals(newId, id)) {
+ if (id != null) {
+ getElement().removeAttribute("id");
+ }
+ id = newId;
+ if (id != null && !id.isEmpty()) {
+ getElement().setId(id);
+ }
+ }
+ }
+
public Widget getComponent() {
return widget;
}