Bill F
Bill F

Reputation: 2087

Dynamic Navigation Rules

On a Custom Control I have defined a Navigation Rule xsp-success go to xpDemo.xsp. This works fine, but the Navigation rule is probably one of the only places that there is not the little blue diamond to allow for a computed result. What I want to do is something like this

(viewScope.get("vsSomething") == "Something) ? "/xpSomeWhere.xsp" : "/xpSomeWhereElse.xsp"

I could define a different xsp-??? for each possible success but that would be a blow-up waiting to happen. In addition I want to re-use the CC in several different situations and the major difference is that where I want to navigate to. I could do a context.reDirectTo() but that then means that I have to repeat the code many times in several different places that might not be totally obvious thus creating a maintenance headache. The obvious place would seem to be the Navigation Rules. I can't believe that I'm the first person wanting to do this but my search has turned up nothing.

Upvotes: 1

Views: 165

Answers (1)

Jesse Gallagher
Jesse Gallagher

Reputation: 4471

They can indeed be computed, just not using the "Navigation" section of the properties pane. If you go instead to the XSP source or to the "navigationRules" element of the "All Properties" section, you can modify the "viewId" property to include a computed value as normal.

Upvotes: 3

Related Questions