cancel
Showing results for 
Search instead for 
Did you mean: 

Can I pass variables into a target view from my Manifest file in a UI5 app?

0 Kudos
I am working on a SuccessFactors extension app in UI5, in my manifest file, I the the following patter to rout:
        {
          "pattern": "candidateDetailsForm/Id={candidateId}",
          "name": "candidateDetailsForm",
          "target": "candidateDetailsForm"
        }

With "candidateDetailsForm":
        {
          "viewId": "candidateDetailsForm",
          "viewName": "CandidateDetailsForm",
          "viewLevel": 1
        }
as the target. If I use the url: .../candidateDetailsForm/Id=1234 for example, it will 
take me to the desired view, however, is there a way I could create a 'var' in the 
attached controller that will contain the {candidateId} part of the url? The website will 
accept any value for the candidateId when typing the url in, is that going to be a problem, and if so, how do I fix it? 

The url will be generated in an automated email sent to a candidate from SuccessFactors, 
with the candidate's Id sent through as part of the url.


CallumRae
Explorer
0 Kudos

Thanks, although I'm not trying to pass a var between two pages, the target page will be accessed by a url link sent in an automated email, which will contain the candidateId as part of the url. This will be handled by SuccessFactors (of which my app is an extension to, so I will probably have to get the var "candidateId" from the url itself.

Accepted Solutions (0)

Answers (1)

Answers (1)

ThorstenHoefer
Active Contributor

Hi callumrae,

you should attach a Methode onRouteMatch in the init function to the router.

The patern coluld also be

"pattern": "candidateDetailsForm/{candidateId}",
url:.../candidateDetailsForm/1234
onInit : function(oEvent) { 
  this.getRouter().getRoute("candidateDetailsForm").attachPatternMatched(this.onRouteMatched);
}

onRouteMatched : function(oEvent) { 
degugger
// get the attributes from oEvent like "oEvent.getParameters()"
}

sss