IDEMPIERE-1341 Wrong label in the Record Info dialog

This commit is contained in:
Carlos Ruiz 2018-07-11 16:49:27 +02:00
parent 0b2d64f89c
commit 8466e356d3
2 changed files with 12 additions and 5 deletions

View File

@ -104,7 +104,7 @@ public class GridTable extends AbstractTableModel
/**
*
*/
private static final long serialVersionUID = -1022887214226173483L;
private static final long serialVersionUID = -2741647620577906242L;
public static final String DATA_REFRESH_MESSAGE = "Refreshed";
public static final String DATA_UPDATE_COPIED_MESSAGE = "UpdateCopied";
@ -550,7 +550,7 @@ public class GridTable extends AbstractTableModel
* @param index index
* @return GridField
*/
protected GridField getField (int index)
public GridField getField (int index)
{
if (index < 0 || index >= m_fields.size())
return null;

View File

@ -35,6 +35,7 @@ import org.adempiere.webui.component.Window;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.util.ZKUpdateUtil;
import org.compiere.model.DataStatusEvent;
import org.compiere.model.GridField;
import org.compiere.model.GridTab;
import org.compiere.model.GridTable;
import org.compiere.model.MChangeLog;
@ -248,14 +249,19 @@ public class WRecordInfo extends Window implements EventListener<Event>
//get uuid
GridTable gridTable = null;
String tabName = null;
if (dse.getSource() instanceof GridTab)
{
GridTab gridTab = (GridTab) dse.getSource();
gridTable = gridTab.getTableModel();
tabName = gridTab.getName();
}
else if (dse.getSource() instanceof GridTable)
{
gridTable = (GridTable) dse.getSource();
gridTable = (GridTable) dse.getSource();
GridField firstField = gridTable.getField(0);
if (firstField != null && firstField.getGridTab() != null)
tabName = firstField.getGridTab().getName();
}
if (gridTable != null && dse.getCurrentRow() >= 0 && dse.getCurrentRow() < gridTable.getRowCount())
{
@ -271,11 +277,12 @@ public class WRecordInfo extends Window implements EventListener<Event>
}
// Title
if (dse.AD_Table_ID != 0)
if (tabName == null && dse.AD_Table_ID != 0)
{
MTable table1 = MTable.get (Env.getCtx(), dse.AD_Table_ID);
setTitle(title + " - " + table1.getName());
tabName = table1.getName();
}
setTitle(title + " - " + tabName);
// Only Client Preference can view Change Log
if (!MRole.PREFERENCETYPE_Client.equals(MRole.getDefault().getPreferenceType()))