This is an automated email from the ASF dual-hosted git repository.
nmalin pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 0b94ecd411 Improved: Lookup don't work on area just updated
(OFBIZ-13332)
0b94ecd411 is described below
commit 0b94ecd411199ae86dd361d410999f926cb50539
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 3896ee8346..09ef194a63 100644
--- a/themes/common-theme/webapp/common-theme/js/util/OfbizUtil.js
+++ b/themes/common-theme/webapp/common-theme/js/util/OfbizUtil.js
@@ -666,11 +666,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).