IDEMPIERE-1248 Performance Optimization: Eliminate the fire and processing of duplicate event. Fixed problem with refresh after process call.
This commit is contained in:
parent
8630ed7597
commit
d1dea0fd02
|
@ -657,6 +657,25 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
|
|||
return new Space();
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn on/off the processing of dynamic display call for current execution cycle.
|
||||
* The system will ignore duplicate dynamic display request within the same execution cycle,
|
||||
* this method can be use to alter that.
|
||||
* @param enable
|
||||
*/
|
||||
public void toggleDynamicDisplay(boolean enable) {
|
||||
Execution exec = Executions.getCurrent();
|
||||
int currentRow = getGridTab().isSortTab() ? 0 : getGridTab().getCurrentRow();
|
||||
StringBuilder builder = new StringBuilder(ON_DYNAMIC_DISPLAY_CALL_EVENT_ATTR)
|
||||
.append("_").append(getUuid())
|
||||
.append("_").append(0)
|
||||
.append("_").append(currentRow);
|
||||
if (enable)
|
||||
exec.removeAttribute(builder.toString());
|
||||
else
|
||||
exec.setAttribute(builder.toString(), Boolean.TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate display properties of fields of current row
|
||||
* @param col
|
||||
|
@ -669,8 +688,10 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
|
|||
col = 0;
|
||||
int currentRow = getGridTab().isSortTab() ? 0 : getGridTab().getCurrentRow();
|
||||
Execution exec = Executions.getCurrent();
|
||||
StringBuilder builder = new StringBuilder(ON_DYNAMIC_DISPLAY_CALL_EVENT_ATTR).append("_")
|
||||
.append(col).append("_").append(currentRow);
|
||||
StringBuilder builder = new StringBuilder(ON_DYNAMIC_DISPLAY_CALL_EVENT_ATTR)
|
||||
.append("_").append(getUuid())
|
||||
.append("_").append(col)
|
||||
.append("_").append(currentRow);
|
||||
String key = builder.toString();
|
||||
if (exec.getAttribute(key) == null)
|
||||
{
|
||||
|
|
|
@ -1559,20 +1559,47 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
|
||||
@Override
|
||||
public void onCallback(Boolean result) {
|
||||
adTabbox.getSelectedGridTab().dataRefreshAll(fireEvent, true);
|
||||
adTabbox.getSelectedTabpanel().dynamicDisplay(0);
|
||||
focusToActivePanel();
|
||||
afterRefresh(fireEvent);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
adTabbox.getSelectedGridTab().dataRefreshAll(fireEvent, true);
|
||||
adTabbox.getSelectedTabpanel().dynamicDisplay(0);
|
||||
focusToActivePanel();
|
||||
afterRefresh(fireEvent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fireEvent
|
||||
*/
|
||||
protected void afterRefresh(final boolean fireEvent) {
|
||||
IADTabpanel headerTab = adTabbox.getSelectedTabpanel();
|
||||
IADTabpanel detailTab = adTabbox.getSelectedDetailADTabpanel();
|
||||
if (headerTab instanceof ADTabpanel)
|
||||
{
|
||||
((ADTabpanel) headerTab).toggleDynamicDisplay(false);
|
||||
}
|
||||
if (detailTab != null && detailTab instanceof ADTabpanel)
|
||||
{
|
||||
((ADTabpanel) detailTab).toggleDynamicDisplay(false);
|
||||
}
|
||||
adTabbox.getSelectedGridTab().dataRefreshAll(fireEvent, true);
|
||||
if (headerTab instanceof ADTabpanel)
|
||||
{
|
||||
((ADTabpanel) headerTab).toggleDynamicDisplay(true);
|
||||
}
|
||||
if (detailTab != null && detailTab instanceof ADTabpanel)
|
||||
{
|
||||
((ADTabpanel) detailTab).toggleDynamicDisplay(true);
|
||||
}
|
||||
headerTab.dynamicDisplay(0);
|
||||
if (detailTab != null)
|
||||
{
|
||||
detailTab.dynamicDisplay(0);
|
||||
}
|
||||
focusToActivePanel();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ToolbarListener#onRefresh()
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue