From 244718e2cf2cf5c25d9301efc56fbbe095ce1c71 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Fri, 26 Jul 2019 20:22:44 +0200 Subject: [PATCH] IDEMPIERE-3939 Tree node label is not updated after update of record --- .../org/adempiere/webui/adwindow/ADTabpanel.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index be30297045..07bd5f0ca4 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -1434,6 +1434,21 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer if (isTreeDrivenByValue()) treePanel.prepareForRefresh(); } + + if ("Saved".equals(e.getAD_Message()) && model.find(null, gridTab.getRecord_ID()) != null && !isTreeDrivenByValue()) + { + DefaultTreeNode treeNode = model.find(null, gridTab.getRecord_ID()); + if (treeNode != null) { // + MTreeNode data = (MTreeNode) treeNode.getData(); + + String label = (isValueDisplayed() ? (gridTab.getValue("Value").toString() + " - ") : "") + gridTab.get_ValueAsString("Name"); + if (!data.getName().equals(label)) { + data.setName(label); + treeNode.setData(data); + } + } + } + if (refresh) { int AD_Tree_ID = Env.getContextAsInt (Env.getCtx(), getWindowNo(), "AD_Tree_ID", true);