diff --git a/ehr/resources/web/ehr/panel/DataEntryPanel.js b/ehr/resources/web/ehr/panel/DataEntryPanel.js index 1c7ff43ae..87c808cc1 100644 --- a/ehr/resources/web/ehr/panel/DataEntryPanel.js +++ b/ehr/resources/web/ehr/panel/DataEntryPanel.js @@ -113,6 +113,12 @@ Ext4.define('EHR.panel.DataEntryPanel', { }, this); } } + + // Show the indicator here rather than relying solely on 'validationstart', which only fires when the in-flight + // request count transitions 0 -> 1. That transition can happen during initial load (where the indicator is + // suppressed) and won't fire again for validations queued behind those requests, leaving the buttons disabled + // with no indicator. Initial-load validation doesn't fire 'beforevalidation', so this stays quiet during load. + this.onValidationStart(); }, onValidationStart: function(){ @@ -148,6 +154,11 @@ Ext4.define('EHR.panel.DataEntryPanel', { return; } + // A validate cycle can send no requests (nothing produced commands), in which case 'validationcomplete' never + // fires. Clear the indicator whenever buttons are recalculated with no requests in flight. + this.validationInProgress = false; + this.setValidationIndicatorVisible(false); + var maxSeverity = sc.getMaxErrorSeverity(); if(EHR.debug && maxSeverity)