cancel
Showing results for 
Search instead for 
Did you mean: 

A view with App tag

Former Member
0 Kudos

Hi all,

Suppose we have two pages, page 1 and page 2, which are corresponding to view 1 and view 2.

Now I have a requirement of navigation from page 1 to page 2, for example, by clicking a button on page 1.

I am wondering if I need App tag in both page 1 and page 2.

Actually, I have gone through the demo and take it as reference, but I didn't get it worked.

I noticed that the demo uses nested views. Only in the root view, App tag is used. Does that matter?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ming,

Navigation in UI5 can be done via Event bus of App or using a Router Mechanism.

If you created application, by keeping sap.m.App at the top level, you can use event bus mechanism directly.

Assume, oApp = new sap.m.App();

               oApp.addPage(page1);

               oApp.addPAge(page2);

then on click from page1, you can navigate to page 2, just by oApp.to(page2, context);

For broader explanations, please search SCN for Navigation. There are lot of threads and blogs available

Regards,

Meganadhan S

Former Member
0 Kudos

Thanks, so do you mean that there is only one App in a project and it can be only put in the root view?

Former Member
0 Kudos

Hi Ming,

Yes Ideally there should be only one App, which will be the root UI for all pages.

However you can achieve a plain app or a master-detail app within this architecture.

Regards,

Meganadhan S

former_member182862
Active Contributor
0 Kudos

hi Ming

here is a small example

JS Bin - Collaborative JavaScript Debugging

raffinkira
Participant
0 Kudos

Thank you, one more question if you allow me, which one you prefer, event bus or router?

raffinkira
Participant
0 Kudos

Thank you, it's so helpful.

NagaPrakashT
Contributor
0 Kudos

Hi Ming,

Routing is preferred. For more info please look at the below references.

Targets(sap.ui.core.routing.Targets) : SAPUI5 Explored

Router(sap.ui.core.routing.Router) : SAPUI5 Explored

Thanks,

Naga

Former Member
0 Kudos

Hi Ming,

Please mark the thread as answered if your issue is resolved. Answered threads will help other developers to get some hint from this .

Regards,

Meganadhan S

Answers (0)