IDEMPIERE-5500 Autorefresh of Table lists not working correctly (#1591)

* IDEMPIERE-5500 Autorefresh of Table lists not working correctly

* - add back reset method as suggested by hengsin
This commit is contained in:
Carlos Ruiz 2022-11-29 12:28:16 +01:00 committed by GitHub
parent 2fa0d49ac4
commit 2870bd56c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 7 deletions

View File

@ -1001,7 +1001,7 @@ ContextMenuListener, IZoomableEditor
/** /**
* generated serial * generated serial
*/ */
private static final long serialVersionUID = 3543247404379028327L; private static final long serialVersionUID = 7813673017009600392L;
private WTableDirEditor editor; private WTableDirEditor editor;
protected CCacheListener(String tableName, WTableDirEditor editor) { protected CCacheListener(String tableName, WTableDirEditor editor) {
@ -1011,13 +1011,19 @@ ContextMenuListener, IZoomableEditor
@Override @Override
public int reset() { public int reset() {
if (editor.getComponent().getDesktop() != null && editor.isReadWrite()) {
refreshLookupList(); refreshLookupList();
return 0;
} }
@Override
public int reset(int recordId) {
refreshLookupList();
return 0; return 0;
} }
private void refreshLookupList() { private void refreshLookupList() {
if (editor.getComponent().getDesktop() == null || !editor.isReadWrite())
return;
Desktop desktop = editor.getComponent().getDesktop(); Desktop desktop = editor.getComponent().getDesktop();
boolean alive = false; boolean alive = false;
if (desktop.isAlive() && desktop.getSession() != null) { if (desktop.isAlive() && desktop.getSession() != null) {
@ -1041,11 +1047,9 @@ ContextMenuListener, IZoomableEditor
@Override @Override
public void newRecord(int record_ID) { public void newRecord(int record_ID) {
if (editor.getComponent().getDesktop() != null && editor.isReadWrite()) {
refreshLookupList(); refreshLookupList();
} }
} }
}
/** /**
* *