Visual Builder

Get Involved. Join the Conversation.

Topic

    Himanshu Sethi
    I want to redirect to a page after previous page is fully...
    Topic posted November 14, 2019 by Himanshu SethiBlue Ribbon: 750+ Points 
    14 Views, 7 Comments
    Title:
    I want to redirect to a page after previous page is fully loaded
    Content:

    Hi

    I have put a condition , where if an article is not found in the existing page , then it should show the message page not found and then it should redirect to home page.

    But in my case it is directly going to home page even after I have given a delay of sometime so that it should hold on to Page not Found message , it is not happening.

    I am using below command for giving some delay and then I am giving redirect to home page, but it's not working

    "setTimeout(function() {}, 160000);" 

    Please let me know what to add to make it work.

    Thanks,

    Himanshu Sethi

    Comment

     

    • John Ceccarelli

      Create a page-level boolean called Loaded then put an event listener on it that listens for a change. Put your logic for forwarding into the action chain linked from that event.

    • Himanshu Sethi

      I have created a boolean variable 'Loaded' with the event as attached in the images. But how and where to assign it after the page is fully loaded so that after full page load it can redirect to home page.

      Image1:Variable Loaded assigned an event

      Image2:Action Chain 

      Image3:articleNotFound method

       

      Thanks

       

       

       

    • John Ceccarelli

      Whatever action chain loads the data in your page, put an Assign Variable action at the end of it and assign variable to true

      • Himanshu Sethi

        Now also same issue is happening , in the attached image , firstly I want to show hideArticle variable action page and then once it is fully loaded I need to proceed to Loaded Variable page.

        But it is directly going to Loaded Variable , here I want to give a delay between these two actions.

        Please let me know if any other details are required.

        Thanks

        • John Ceccarelli

          adding a timeout is not going to reliably solve your problem. you want to programatically trigger the action after the page is loaded. Don't know what you mean by "want to show hideArticle variable action page "

    • Shay Shmeltzer

      I think a better approach would be to use the notification action to show a message rather than navigate to a page and then away from it.

      So the action chain would be call REST query - if no records returned show the notification - navigate to the page

      • Himanshu Sethi

        Hi All

        I am able to give a slight delay between two actions with below code.

        FlowModule.prototype.articleNotFound = function() {
              var timer = setTimeout(function() {
                window.location.href = "./" + "?shell=home";
              }, 10000);
            };

        Thanks