Reputation: 3484
If I use
context.redirectToPrevious()
It works great, but If I call an xagent with or without state between opening the document and doing a close of the document. I end up navigating to the xagent. And If I go directly to the view behind I loose opened categories in the view.
Is there a way to block an xpage to end up in the navigation/history tree?
Upvotes: 1
Views: 104
Reputation: 15739
There are two approaches that would work.
The first is to use client-side JavaScript to open the XAgent. How you handle that will depend on whether there are values set in the browser that you are passing to sessionScope
for the XAgent to use. If not, you can just use client-side JavaScript to open the relevant XAgent page. If you do need values, there are two options:
sessionScope
variables.sessionScope
and open the XAgent page via client-side JavaScript either in the onComplete()
event (will trigger every time) or using view.postScript()
, passing the relevant CSJS as a string (will only trigger if validation is successful).The second is to set the previous page in the beforePageLoad
event and then use that value in context.redirectToPage()
.
Upvotes: 2