cancel
Showing results for 
Search instead for 
Did you mean: 

Navigation between views in Desktop SAPUI5 application

0 Kudos

Hi Experts,


What is the recommended way (Best practice) for navigation between views in Desktop SAPUI5 application?

Samples code and references will be appreciated. 

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182862
Active Contributor
0 Kudos
0 Kudos

Hi Dennis

  

As I know 'routing' is the recommended method for MOBILE SAPUI5 application. I'm looking for the correct way to implement navigation between views on SAPUI5 DESKTOP application.

I didn't understand how the link that you attached demonstrates navigation between views (in the same page and not by Tabs).

Thanks in advance for your inputs.

Qualiture
Active Contributor
0 Kudos

Routing is also the preferred method for desktop applications (there should be no difference between mobile and desktop since the preferred rendering method for UI5 applications is to be responsive anyway)

It should make no difference if the navigation is triggered outside the view (in tabs) or inside the various views (using navigation buttons, links, etc)

0 Kudos

Robin,

Thanks for your answer. Can you please refer me to small working sample?

Qualiture
Active Contributor
0 Kudos

Yeah, have a look the Application Best Practices - Step 3 at https://sapui5.hana.ondemand.com/sdk/#docs/guide/688f36bd758e4ce2b4e682eef4dc794e.html

former_member184741
Active Contributor
0 Kudos

Hi,

Look at the below blog

thanks,

sankar

ChandraMahajan
Active Contributor
0 Kudos

Here is another example based on sap.m library Routing Example Page

Check the source code as well as launch the developer tool in chrome browser(F12), you will observe different views (App.view.xml, Master.view.xml, Detail.view.xml etc) getting loaded. Same can be verified for desktop based application which Dennis shared.

Regards,

Chandra

Answers (3)

Answers (3)

SergioG_TX
Active Contributor
0 Kudos

Yoel,

as you have seen from everyone here, Routing is the preferred method on sapui5. Just to add to what others said... Routing is also used in other web technologies and frameworks, therefore, using Routing would be your best option and also if you are interested in other frameworks, it would be helpful to learn it and apply it in other areas.

0 Kudos

Sergio,

Thanks for your recommendation. I will appreciate it if you can kindly demonstrate how to use 'Routing' by small sample desktop application (like Samba's above this discussion. in JSbin, Github ).

Thanks

SergioG_TX
Active Contributor
Former Member
0 Kudos

Hi Yoel,

Check this out

Cheers,

Samba

romit_raina
Active Participant
0 Kudos

Hello ,

No doubt Routing is best way fro navigation ; here i am giving you the second Option of Navigation as you required.

Using UriParam to navigate from one view to another .

How to use :

     Lets take example In view 1 you have Text field say "TF-Txt1", now we need to set the value which you are entering in the screen , using


                    TF-Txt1.setValue(jQuery.sap.getUriParameters().get("myUriParam"));

Once you set this you can use in Next view(View2) , if you need to get this value in other text field then :

oTF-Txt2 = new sap.ui.commons.TextField({

              id : 'Text2',

              tooltip : 'Text2',

              editable : true,

              value : jQuery.sap.getUriParameters().get("myUriParam"),

      });

Thanks

Romit Raina.

jmoors
Active Contributor
0 Kudos

How is this example navigating between views? at best it's trying to pass avalue by parameter, but this can be achieved by using the routing, and it's better to bind to a model context.

Regards,

Jason

romit_raina
Active Participant
0 Kudos

Hello Jason,

You are correct the above example pass the parameter from one view to another. I put an example of passing parameter from one view to another.

Also as I mentioned previously, routing is best way for navigation.

Thanks !!