IDEMPIERE-38 Tabs from a same window can't be translated the same way
http://jira.idempiere.com/browse/IDEMPIERE-38
This commit is contained in:
parent
decee906ff
commit
b6ad91115a
|
@ -76,6 +76,7 @@ public class ADButtonTabList extends Panel implements IADTabList, EventListener
|
||||||
button.setDynamicProperty("Title", tabLabel.description);
|
button.setDynamicProperty("Title", tabLabel.description);
|
||||||
button.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "ADButtonTab" + i);
|
button.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "ADButtonTab" + i);
|
||||||
Text text = new Text(tabLabel.label);
|
Text text = new Text(tabLabel.label);
|
||||||
|
text.setAttribute("ad_tab_id", tabLabel.AD_Tab_ID);
|
||||||
button.appendChild(text);
|
button.appendChild(text);
|
||||||
int s = tabbox.getSelectedIndex();
|
int s = tabbox.getSelectedIndex();
|
||||||
|
|
||||||
|
@ -155,8 +156,14 @@ public class ADButtonTabList extends Panel implements IADTabList, EventListener
|
||||||
for (ADTabLabel tabLabel : listItems) {
|
for (ADTabLabel tabLabel : listItems) {
|
||||||
Text text = (Text) button.getFirstChild();
|
Text text = (Text) button.getFirstChild();
|
||||||
if (tabLabel.label.equals(text.getValue())) {
|
if (tabLabel.label.equals(text.getValue())) {
|
||||||
|
if (text.getAttribute("ad_tab_id") == null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Integer tabId = (Integer) text.getAttribute("ad_tab_id");
|
||||||
|
if (tabLabel.AD_Tab_ID == tabId) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,8 @@ public class ADTabListModel extends AbstractListModel implements ListitemRendere
|
||||||
public String label;
|
public String label;
|
||||||
public int tabLevel;
|
public int tabLevel;
|
||||||
public String description;
|
public String description;
|
||||||
|
public int windowNo = -1;
|
||||||
|
public int AD_Tab_ID = -1;
|
||||||
|
|
||||||
public ADTabLabel(String label, int tabLevel) {
|
public ADTabLabel(String label, int tabLevel) {
|
||||||
this.label = label;
|
this.label = label;
|
||||||
|
@ -58,6 +60,12 @@ public class ADTabListModel extends AbstractListModel implements ListitemRendere
|
||||||
this(label,tabLevel);
|
this(label,tabLevel);
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ADTabLabel(String label, int tabLevel, String description, int windowNo, int AD_Tab_ID) {
|
||||||
|
this(label,tabLevel,description);
|
||||||
|
this.windowNo = windowNo;
|
||||||
|
this.AD_Tab_ID = AD_Tab_ID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(Listitem item, Object data) throws Exception {
|
public void render(Listitem item, Object data) throws Exception {
|
||||||
|
|
|
@ -71,7 +71,8 @@ public class CompositeADTab extends AbstractADTab
|
||||||
tabPanel.setParent(div);
|
tabPanel.setParent(div);
|
||||||
tabPanel.setVisible(false);
|
tabPanel.setVisible(false);
|
||||||
|
|
||||||
ADTabListModel.ADTabLabel tabLabel = new ADTabListModel.ADTabLabel(gTab.getName(), gTab.getTabLevel(),gTab.getDescription());
|
ADTabListModel.ADTabLabel tabLabel = new ADTabListModel.ADTabLabel(gTab.getName(), gTab.getTabLevel(),gTab.getDescription(),
|
||||||
|
gTab.getWindowNo(),gTab.getAD_Tab_ID());
|
||||||
tabLabelList.add(tabLabel);
|
tabLabelList.add(tabLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue