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:
Carlos Ruiz 2011-11-10 15:41:31 -05:00
parent decee906ff
commit b6ad91115a
3 changed files with 18 additions and 2 deletions

View File

@ -76,6 +76,7 @@ public class ADButtonTabList extends Panel implements IADTabList, EventListener
button.setDynamicProperty("Title", tabLabel.description);
button.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, "ADButtonTab" + i);
Text text = new Text(tabLabel.label);
text.setAttribute("ad_tab_id", tabLabel.AD_Tab_ID);
button.appendChild(text);
int s = tabbox.getSelectedIndex();
@ -155,7 +156,13 @@ public class ADButtonTabList extends Panel implements IADTabList, EventListener
for (ADTabLabel tabLabel : listItems) {
Text text = (Text) button.getFirstChild();
if (tabLabel.label.equals(text.getValue())) {
break;
if (text.getAttribute("ad_tab_id") == null) {
break;
}
Integer tabId = (Integer) text.getAttribute("ad_tab_id");
if (tabLabel.AD_Tab_ID == tabId) {
break;
}
}
i++;
}

View File

@ -48,6 +48,8 @@ public class ADTabListModel extends AbstractListModel implements ListitemRendere
public String label;
public int tabLevel;
public String description;
public int windowNo = -1;
public int AD_Tab_ID = -1;
public ADTabLabel(String label, int tabLevel) {
this.label = label;
@ -58,6 +60,12 @@ public class ADTabListModel extends AbstractListModel implements ListitemRendere
this(label,tabLevel);
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 {

View File

@ -71,7 +71,8 @@ public class CompositeADTab extends AbstractADTab
tabPanel.setParent(div);
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);
}