Skip to content

Commit

Permalink
Fix #809: @ViewScoped unload fails when parent form is updated by ID
Browse files Browse the repository at this point in the history
  • Loading branch information
BalusC committed May 10, 2024
1 parent 5caab42 commit b07c715
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ OmniFaces.Unload = (function(Util, navigator, window, document) {
}

if (id == null) {
var form = getFacesForm();

if (!form) {
if (!getFacesForm()) {
if ((!window.jsf || jsf.getProjectStage() == "Development") && window.console && console.error) {
console.error(ERROR_MISSING_FORM);
}
Expand All @@ -66,6 +64,7 @@ OmniFaces.Unload = (function(Util, navigator, window, document) {
}

try {
var form = getFacesForm();
var url = form.action;
var query = "omnifaces.event=unload&id=" + id + "&" + VIEW_STATE_PARAM + "=" + encodeURIComponent(form[VIEW_STATE_PARAM].value);
var contentType = "application/x-www-form-urlencoded";
Expand Down Expand Up @@ -131,4 +130,4 @@ OmniFaces.Unload = (function(Util, navigator, window, document) {

return self;

})(OmniFaces.Util, navigator, window, document);
})(OmniFaces.Util, navigator, window, document);

0 comments on commit b07c715

Please sign in to comment.