This is an automated email from the ASF dual-hosted git repository.

nmalin pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git

commit 9bfe9775532d8d681b1ea408a405638df9a6a03a
Author: Nicolas Malin <[email protected]>
AuthorDate: Tue Dec 23 16:55:55 2025 +0100

    Improved: Lookup don't work on area just updated (OFBIZ-13332)
    
    If you realize a search on Find Invoice screen 
(https://demo-stable.ofbiz.apache.org/accounting/control/findInvoices), at the 
return you lost Lookup and date picker.
    
    This come from the js function who update the area, HTML is correctly 
injected, but bind Observer aren't recalculate it.
    
    So to fix it, after an area update, we call bindObserver() method to scan 
the new area injected on DOM
---
 themes/common-theme/webapp/common-theme/js/util/OfbizUtil.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/themes/common-theme/webapp/common-theme/js/util/OfbizUtil.js 
b/themes/common-theme/webapp/common-theme/js/util/OfbizUtil.js
index 3e5652ea4d..b06a4e2743 100644
--- a/themes/common-theme/webapp/common-theme/js/util/OfbizUtil.js
+++ b/themes/common-theme/webapp/common-theme/js/util/OfbizUtil.js
@@ -670,11 +670,15 @@ function ajaxUpdateArea(areaId, target, targetParams) {
 
 function updateArea(areaId, data) {
     // If the area is indicate as embedded why replace the area instead inject 
into
+    var bindObserversArea = "#" + areaId
     if (/^embedded/.test(areaId)) {
         jQuery("#" + areaId).replaceWith(data);
+        const newContentId = $(data).filter('.embeddedScreen').attr('id');
+        bindObserversArea = "#" + newContentId;
     } else {
         jQuery("#" + areaId).html(data);
     }
+    bindObservers(bindObserversArea);
 }
 
 /** Update multiple areas (HTML container elements).

Reply via email to