cancel
Showing results for 
Search instead for 
Did you mean: 

Routing - ID of view

kai2015
Contributor
0 Kudos

Hi,

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,

Kai

Tags edited by: Michael Appleby

Accepted Solutions (0)

Answers (2)

Answers (2)

maximilian_lenkeit
Participant
0 Kudos

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

kai2015
Contributor
0 Kudos

Hi,

thanks for your reply.

Routing works fine at me.

I want to transfer data or call a function from another view.

And set a model to the core isn't enough for me...

Because ID of XML view can change, I thought there could be another way.

Do you know how?

kai2015
Contributor
0 Kudos

Any new ideas community?

Or couldn't you understand my question?

kind regards,

Kai

agentry_src
Active Contributor
0 Kudos

Hi Kai,

Added some tags to your Discussion.  Perhaps that will get more people to take a look at it.

Regards, Mike (Moderator)

SAP Customer Experience Group - CEG

kai2015
Contributor
0 Kudos

Thanks! I hope so...