Skip to Content

Navigation between views in Desktop SAPUI5 application

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    Jan 04, 2015 at 06:19 PM
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 16, 2015 at 05:11 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 16, 2015 at 05:08 PM

    Hi Yoel,

    Check this out https://blogs.sap.com/?p=119538

    Cheers,

    Samba

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 05, 2015 at 02:42 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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 !!