user1339222
user1339222

Reputation: 56

Navigation rules with xpage returning to another application does not work

I'm calling an xpage from a portal xpage and would like to return to the portal on success or cancel. I've set the next page(success or cancel) rule to Previous page. When I test with a simple cancel button it does not return to the previous page. In summary Application A opens a page in Application B in edit mode. When I click on a cancel button in Application B it does not return to Application A.

<xp:this.navigationRules>
<xp:navigationRule
    outcome="xsp-success"
    viewId="$$PreviousPage"></xp:navigationRule>
</xp:this.navigationRules>

I then tried with sessionScope variable with the return URL but the sessionScope variable does not seem to be available in Application B.

I must be missing something really basic. Can anyone give me a hand ? Thanks

Upvotes: 0

Views: 362

Answers (1)

Sven Hasselbach
Sven Hasselbach

Reputation: 10485

Navigation rules apply only per application. "Special" rules like $$HomePage will always return to the application root, and $$PreviousPage will return to the last page stored in sessionScope. The last page in sessionScope is also application specific, that's why this is not working.

Try to open your application B with an URL parameter and store this parameter in the sessionScope of application B. Instead of using a navigation rule, you can simply do a redirect if a user cancels.

Upvotes: 2

Related Questions