diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index cb41e21..eb2c1f0 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -33,6 +33,7 @@ namespace Test.UI.Components.Pages #region Protected Fields protected string currJwd = "..."; + protected string prevJwd = ""; protected Dictionary m_CurrArgs = new Dictionary(); #endregion Protected Fields @@ -217,12 +218,21 @@ namespace Test.UI.Components.Pages private async Task SaveJWD(Dictionary CurrArgs) { m_CurrArgs = CurrArgs; - // chiamo la chiamata POST alla API, che manda la richiesta via REDIS - if (currJwd != null) + // verifico se contiene JWD, lo aggiorno + if (CurrArgs.ContainsKey("Jwd")) { + currJwd = CurrArgs["Jwd"]; + CurrData.CurrJwd = currJwd; + } + + // se il SSE variato --> invio + if (!currJwd.Equals(prevJwd)) + { + prevJwd = currJwd; CalcRequestDTO calcRequestDTO = new CalcRequestDTO(); calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW; calcRequestDTO.DictExec = m_CurrArgs; + // chiamo la chiamata POST alla API, che manda la richiesta via REDIS await ICService.CallRestPost($"{apiUrl}/{GenericBasePath}", $"{calcTag}/{CalcUid}", calcRequestDTO); } } diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 6d88081..e30c160 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -587,11 +587,21 @@ namespace WebWindowComplex { if (m_CurrWindow != null) { +#if DEBUG var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented); - Dictionary Args = new Dictionary(); - Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}"); - Args.Add("Jwd", CurrJwd); - await EC_OnUpdate.InvokeAsync(Args); +#else + var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize()); +#endif + // verifico variazione JWD + if (!prevJwd.Equals(CurrJwd)) + //if (!prevJwd.Equals(LiveData.CurrJwd) || !prevJwd.Equals(CurrJwd)) + { + prevJwd = CurrJwd; + Dictionary Args = new Dictionary(); + Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}"); + Args.Add("Jwd", CurrJwd); + await EC_OnUpdate.InvokeAsync(Args); + } } } @@ -641,16 +651,11 @@ namespace WebWindowComplex await EC_OnSelectedTemplate.InvokeAsync(newSel); } - protected override async Task OnInitializedAsync() - { - await DoPreviewSvg(); - } - /// /// Gestione update post ricezione parametri da controllo chiamante /// - protected override void OnParametersSet() + protected override async Task OnParametersSetAsync() { // controllo elenchi BasePayload siano validi... if (ListPayload.IsValid()) @@ -681,9 +686,16 @@ namespace WebWindowComplex } if (SashList.Count > 0) currAnta = 0; + + await DoPreviewSvg(); } } + /// + /// Salvataggio JWD precedente x evitare loop su update + /// + private string prevJwd { get; set; } = ""; + protected void setCurrWindow(JsonWindow WindowFromJson) { if (m_CurrWindow != null) diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index cd0b747..7258839 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.712 + 2.7.10.713 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -59,6 +59,21 @@ + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 55bf014..59834fa 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.10.712 + 2.7.10.713 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -74,6 +74,21 @@ + + + + + + + + + + + + + + +