IDEMPIERE-5177 - Fiixed search in detail broken after navigating betw… (#1396)

* IDEMPIERE-5177 - Fiixed search in detail broken after navigating between master records

* IDEMPIERE-5177 - Fixed search in detail broken after navigating between master records
This commit is contained in:
Diego Ruiz 2022-07-18 15:23:50 +02:00 committed by GitHub
parent edc590967e
commit 090893e051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 10 deletions

View File

@ -2305,9 +2305,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
private void doOnFind() {
// Gets Fields from AD_Field_v
GridField[] findFields = adTabbox.getSelectedGridTab().getFields();
if (getCurrentFindWindow() == null || !getCurrentFindWindow().validate(adTabbox.getSelectedGridTab().getWindowNo(), adTabbox.getSelectedGridTab().getName(),
adTabbox.getSelectedGridTab().getAD_Table_ID(), adTabbox.getSelectedGridTab().getTableName(),
adTabbox.getSelectedGridTab().getWhereExtended(), findFields, 1, adTabbox.getSelectedGridTab().getAD_Tab_ID())) {
if (!isCurrentFindWindowValid()) {
if (!getFindWindow(findFields))
return;
}
@ -2370,6 +2368,22 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
showBusyMask(getCurrentFindWindow());
LayoutUtils.openEmbeddedWindow(toolbar, getCurrentFindWindow(), "after_start");
}
/**
* Validates if the current FindWindow corresponds to the actve tab and record
* @return true if the current find window is good to use
*/
private boolean isCurrentFindWindowValid() {
GridField[] findFields = adTabbox.getSelectedGridTab().getFields();
return getCurrentFindWindow() != null && getCurrentFindWindow().validate(adTabbox.getSelectedGridTab().getWindowNo(),
adTabbox.getSelectedGridTab().getName(),
adTabbox.getSelectedGridTab().getAD_Table_ID(),
adTabbox.getSelectedGridTab().getTableName(),
adTabbox.getSelectedGridTab().getWhereExtended(),
findFields,
1,
adTabbox.getSelectedGridTab().getAD_Tab_ID());
}
@Override
public void onIgnore()
@ -3200,10 +3214,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
public void doOnQueryChange() {
// Gets Fields from AD_Field_v
GridField[] findFields = adTabbox.getSelectedGridTab().getFields();
if (getCurrentFindWindow() == null || !getCurrentFindWindow().validate(adTabbox.getSelectedGridTab().getWindowNo(), adTabbox.getSelectedGridTab().getName(),
adTabbox.getSelectedGridTab().getAD_Table_ID(), adTabbox.getSelectedGridTab().getTableName(),
adTabbox.getSelectedGridTab().getWhereExtended(), findFields, 1, adTabbox.getSelectedGridTab().getAD_Tab_ID())) {
if (!isCurrentFindWindowValid()) {
if (!getFindWindow(findFields))
return;
}
@ -3944,9 +3955,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
}
public boolean getFindWindow(GridField[] findFields) {
FindWindow findWindow;
if (tabFindWindowHashMap.get(adTabbox.getSelectedGridTab()) != null) {
findWindow = tabFindWindowHashMap.get(adTabbox.getSelectedGridTab());
FindWindow findWindow = getCurrentFindWindow();
if (findWindow != null && isCurrentFindWindowValid()) {
toolbar.setSelectedUserQuery(findWindow.getAD_UserQuery_ID());
} else {
findWindow = new FindWindow (adTabbox.getSelectedGridTab().getWindowNo(), adTabbox.getSelectedGridTab().getTabNo(), adTabbox.getSelectedGridTab().getName(),