You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2020/12/15 13:47:08 UTC

[myfaces-tobago] branch tobago-2.x updated (e96a359 -> 4982af8)

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

weber pushed a change to branch tobago-2.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git.


    from e96a359  TOBAGO-2061: Window Scope broken
     new 785fbd4  TOBAGO-2062 - Tobago2: Navigation after ajax request not working on immediate
     new 4982af8  TOBAGO-2062 - Tobago2: Navigation after ajax request not working on immediate: deltaspike.js

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../tobago/internal/ajax/AjaxNavigationListener.java     |  5 ++++-
 .../tobago/internal/ajax/AjaxNavigationState.java        |  2 +-
 .../html/standard/standard/script/tobago-deltaspike.js   | 16 +++++++++-------
 3 files changed, 14 insertions(+), 9 deletions(-)


[myfaces-tobago] 01/02: TOBAGO-2062 - Tobago2: Navigation after ajax request not working on immediate

Posted by we...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

weber pushed a commit to branch tobago-2.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 785fbd4cf31d2d80ac59387ad450a6331693ff85
Author: Volker Weber <v....@inexso.de>
AuthorDate: Tue Dec 15 10:57:55 2020 +0100

    TOBAGO-2062 - Tobago2: Navigation after ajax request not working on immediate
---
 .../apache/myfaces/tobago/internal/ajax/AjaxNavigationListener.java  | 5 ++++-
 .../org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationListener.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationListener.java
index 6ba9c4e..e254e99 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationListener.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationListener.java
@@ -37,8 +37,11 @@ public class AjaxNavigationListener implements PhaseListener {
     if (!facesContext.getResponseComplete()) {
       if (phaseEvent.getPhaseId() == PhaseId.RESTORE_VIEW) {
         AjaxNavigationState.afterRestoreView(facesContext);
+      } else if (phaseEvent.getPhaseId() == PhaseId.APPLY_REQUEST_VALUES
+          && facesContext.getRenderResponse()) {
+        AjaxNavigationState.checkNavigation(facesContext);
       } else if (phaseEvent.getPhaseId() == PhaseId.INVOKE_APPLICATION) {
-        AjaxNavigationState.afterInvokeApplication(facesContext);
+        AjaxNavigationState.checkNavigation(facesContext);
       }
     }
     debug(facesContext);
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java
index 2dca522..6932eac 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java
@@ -196,7 +196,7 @@ public final class AjaxNavigationState {
     return false;
   }
 
-  public static void afterInvokeApplication(FacesContext facesContext) {
+  public static void checkNavigation(FacesContext facesContext) {
     if (AjaxUtils.isAjaxRequest(facesContext) && isNavigation(facesContext)) {
       try {
         AjaxInternalUtils.requestNavigationReload(facesContext, new AjaxNavigationState(facesContext));


[myfaces-tobago] 02/02: TOBAGO-2062 - Tobago2: Navigation after ajax request not working on immediate: deltaspike.js

Posted by we...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

weber pushed a commit to branch tobago-2.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 4982af897d91458b08552c58de8c7b3b6ef1daec
Author: Volker Weber <v....@inexso.de>
AuthorDate: Tue Dec 15 14:35:58 2020 +0100

    TOBAGO-2062 - Tobago2: Navigation after ajax request not working on immediate: deltaspike.js
---
 .../html/standard/standard/script/tobago-deltaspike.js   | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-deltaspike.js b/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-deltaspike.js
index 876a3c3..967d0ba 100644
--- a/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-deltaspike.js
+++ b/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-deltaspike.js
@@ -18,13 +18,15 @@
  */
 
 jQuery(document).ready(function() {
-  var dswid = location.search.replace(/.*dswid=(\-?[0-9]+).*/, "$1");
-  if (dswid) {
-    dswh.init(dswid, 'LAZY', 10, {
-      'tokenizedRedirect': false,
-      'storeWindowTreeOnLinkClick': true,
-      'storeWindowTreeOnButtonClick': false
-    });
+  if (location.search.match(/.*dswid=(\-?[0-9]+).*/) !== null) {
+    var dswid = location.search.replace(/.*dswid=(\-?[0-9]+).*/, "$1");
+    if (dswid) {
+      dswh.init(dswid, 'LAZY', 10, {
+        'tokenizedRedirect': false,
+        'storeWindowTreeOnLinkClick': true,
+        'storeWindowTreeOnButtonClick': false
+      });
+    }
   }
 });