1
0
-1


I am having two pages in a form and I am having some set of conditions and API calls in continue button for the navigation to next page, but I am able to navigate to the next page by clicking on the page level navigation bar(Navigation chevron), because of this action the conditions and calls for API are failing.

We tried the below way
1)Created a JS library with a function doing everything like DDS call that i want to do on a page move and called that function in the Click rule of the Continue button and Created a Form Load rule that adds a click event listener to the navbar via JQuery and calling the function from the library on click

Note : my code having the below line for identifying the page navigatedFrom and navigatedTo

var navigatedFrom = info.from;
var navigatedTo = info.to;

below is the error i am getting in the console

app.js:676 ReferenceError: info is not defined
at pageMove (app.js:18227)
at Rules.click_wizard_continue (app.js:6630)
at fn (eval at compile (app.js:793), <anonymous>:4:693)
at b (app.js:684)
at e (app.js:838)
at b.$eval (app.js:703)
at b.$apply (app.js:704)
at HTMLButtonElement.<anonymous> (app.js:838)
at HTMLButtonElement.dispatch (app.js:4)
at HTMLButtonElement.r.handle (app.js:4)

please help to suggest an idea to overcome this.

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      The info object contains event specific data and is not always present. For the Page Change rule the info object contains the from and to page information because this is information relevant to the page change event type. This same info is not relevant to a generic button click rule and is therefore not available in to that event type.

      See this related topic for more info:

      Dynamic data call on page change

      You could try either of the suggestions on the page above to achieve what you want. Other related topic:

      How do I execute a script on page change?

      The Page Change rule is only available on the Page Controller which is the container for the form pages:

      Alternatively you could click on any page and add a Page Load rule.

      CommentAdd your comment...