IDEMPIERE-3939 Tree node label is not updated after update of record

This commit is contained in:
Nicolas Micoud 2019-07-26 20:22:44 +02:00
parent 96508b61f7
commit 244718e2cf
1 changed files with 15 additions and 0 deletions

View File

@ -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<Object> 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);