Skip to Content

Routing - ID of view


I am using the routing examples from Best Practise tutorial.

SAPUI5 SDK - Demo Kit

My Problem is how the give an xml view an id?

Can I define the id in the routing table at component.js?

If there is no way to set an id to an xmlview, how the get the id of the view, where the router has navigated to?

kind regards,


Tags edited by: Michael Appleby

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 11, 2014 at 03:32 PM

    You don't need to assign ids to views for the routing to work.

    What you need, however, is the targetControl parameter in the routing config, which has to be the id of a control. This can either be a global id, or an id inside a view. For that latter to work, you'll need to maintain a rootView in your Component metadata (like in the sample app). If you compare the routing config (targetControl) with the XML view that is references by rootView, you'll see what I'm talking about.

    You can easily look at the XML source via Chrome's Network tab.

    - Max

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 11, 2014 at 11:41 AM

    Any new ideas community?

    Or couldn't you understand my question?

    kind regards,


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.