From c35ed9b6fcb1a653ad05258a8a9109afa0a4f1d4 Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Mon, 13 Jul 2026 21:17:44 -0600 Subject: [PATCH 1/2] GH Issue 1186: Show validation indicator whenever validation disables the submit buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Validating... indicator added with the submit-button disabling relied solely on the 'validationstart' event, which only fires when the in-flight validation request count transitions from 0 to 1. That transition can happen during initial form load, where the indicator is deliberately suppressed, and it does not fire again for validations queued behind those requests — leaving the buttons disabled with no indicator. Show the indicator from 'beforevalidation' (the same event that disables the buttons) so the two stay in sync. Also clear the indicator whenever the buttons are recalculated with no requests in flight, since a validate cycle that produces no commands sends no requests and never fires 'validationcomplete'. --- ehr/resources/web/ehr/panel/DataEntryPanel.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ehr/resources/web/ehr/panel/DataEntryPanel.js b/ehr/resources/web/ehr/panel/DataEntryPanel.js index 1c7ff43ae..d3fe369b0 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) @@ -368,6 +379,16 @@ Ext4.define('EHR.panel.DataEntryPanel', { this.add(toAdd); this.hasStoreCollectionLoaded = true; + + // Load-time validation requests start before the form renders, so 'validationstart' has already fired (and + // was suppressed) and 'beforevalidation' never fires for them. If they are still in flight once the form is + // visible, show the indicator directly; 'validationcomplete' will hide it when they drain. + // Ext4.defer(function(){ + // if (this.storeCollection && this.storeCollection.validationRequestsInFlight > 0){ + // this.validationInProgress = true; + // this.setValidationIndicatorVisible(true); + // } + // }, this.storeCollection.clientDataChangeBuffer * 2, this); }, updateMinWidth: function(minWidth){ From 16c5980709fb7b1944eb1644af45a43908697dec Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Tue, 14 Jul 2026 10:42:44 -0600 Subject: [PATCH 2/2] GH Issue 1186: Remove commented-out load-time indicator handling --- ehr/resources/web/ehr/panel/DataEntryPanel.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ehr/resources/web/ehr/panel/DataEntryPanel.js b/ehr/resources/web/ehr/panel/DataEntryPanel.js index d3fe369b0..87c808cc1 100644 --- a/ehr/resources/web/ehr/panel/DataEntryPanel.js +++ b/ehr/resources/web/ehr/panel/DataEntryPanel.js @@ -379,16 +379,6 @@ Ext4.define('EHR.panel.DataEntryPanel', { this.add(toAdd); this.hasStoreCollectionLoaded = true; - - // Load-time validation requests start before the form renders, so 'validationstart' has already fired (and - // was suppressed) and 'beforevalidation' never fires for them. If they are still in flight once the form is - // visible, show the indicator directly; 'validationcomplete' will hide it when they drain. - // Ext4.defer(function(){ - // if (this.storeCollection && this.storeCollection.validationRequestsInFlight > 0){ - // this.validationInProgress = true; - // this.setValidationIndicatorVisible(true); - // } - // }, this.storeCollection.clientDataChangeBuffer * 2, this); }, updateMinWidth: function(minWidth){