Skip to content

Commit 0002e17

Browse files
author
Leila
committed
Improved: Lookup don't work on area just updated (OFBIZ-13332)
1 parent 82d0c73 commit 0002e17

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

themes/common-theme/webapp/common-theme/js/util/OfbizUtil.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -670,15 +670,11 @@ function ajaxUpdateArea(areaId, target, targetParams) {
670670

671671
function updateArea(areaId, data) {
672672
// If the area is indicate as embedded why replace the area instead inject into
673-
var bindObserversArea = "#" + areaId
674673
if (/^embedded/.test(areaId)) {
675674
jQuery("#" + areaId).replaceWith(data);
676-
const newContentId = $(data).filter('.embeddedScreen').attr('id');
677-
bindObserversArea = "#" + newContentId;
678675
} else {
679676
jQuery("#" + areaId).html(data);
680677
}
681-
bindObservers(bindObserversArea);
682678
}
683679

684680
/** Update multiple areas (HTML container elements).
@@ -851,6 +847,12 @@ function ajaxSubmitFormUpdateAreas(formName, areaCsvString, close) {
851847
areaId = $form[0].target
852848
}
853849
updateArea(areaId, data)
850+
var bindObserversArea = "#" + areaId
851+
if (/^embedded/.test(areaId)) {
852+
const newContentId = $(data).filter('.embeddedScreen').attr('id');
853+
bindObserversArea = "#" + newContentId;
854+
}
855+
bindObservers(bindObserversArea);
854856
} else {
855857
if (containsErrorMessages(data)) {
856858
displayErrorMessages(data)

0 commit comments

Comments
 (0)