In this exercise you will create a new page using Side Drawer Navigation page type and will add side drawer items to display the information.
Side Drawer Navigation page provides a slide out menu navigation option and can be used to provide the similar functionality to the Bottom Navigation page type but supports more than 5 areas within your application. This page type can only be used as the MainPage
in the Application.app
.
-
In SAP Business Application Studio project, right-click the
Pages
|MDK: New Page
. -
Select
Side Drawer Navigation Page
and clickNext
. -
Enter the
Page Name
as Overview and clickNext
and theFinish
on the confirmation step.The generated page has a default Side Drawer Header and a section.
In next step, you will update the default page schema and add some additional Side Drawer sections.
-
Select the Header area and click on the
link
icon for the Headline property to open the Object Browser. Choose Control & Client Data in the dropdown and double-click on theUserId(Value)
. Click OK to set the value in the control field.#Application/#AppData/UserId
will return theUserId
of current user. You can find more information about such target path in this documentation. -
For other properties, provide below information:
Property Value IconIsCircular
true SubHeadline
Remove the default value and leave it blank -
Select
Item0
on the page preview. InProperties
pane, under theData
section, click the expand node forItem0
and provide the below information in the Properties pane to display Customers list.Property Value Image
sap-icon://customer Name
Customers PageToOpen
click on the 3 dots icon, select the Object Browser
and bind it to Customers_List.pageTitle
Customers You will now see the Side Drawer Section item is now bound to Customers.
You will now add additional items to display other info.
-
Click the Add button and add 3 more items.
You should now have total 4 items.
-
Provide the below information for the second item in the Properties pane to display Products list:
Property Value Image
sap-icon://product Name
Products PageToOpen
click on the 3 dots icon, select the Object Browser
and bind it to Products_List.pageTitle
Products -
Provide the below information for the third item in the Properties pane to display Suppliers list:
Property Value Image
sap-icon://supplier Name
Suppliers PageToOpen
click on the 3 dots icon, select the Object Browser
and bind it to Suppliers_List.pageTitle
Suppliers -
Provide the below information for the fourth item in the Properties pane to display Sales Orders list:
Property Value Image
sap-icon://sales-order Name
SalesOrders PageToOpen
click on the 3 dots icon, select the Object Browser
and bind it to SalesOrderHeaders_List.pageTitle
Sales Orders The Overview page layout should look like below:
In the template generated project, there is already a page called Main.page which is also the page that opens after successful onboarding. For this exercise, you will change the default behavior of the app launch binding it to the Overview page. Please note that Side Drawer Navigation page type can only be used as the MainPage in the Application.app, you cannot open it being on any other page.
-
Right-click the
Application.app
file in the project explorer pane, selectMDK:Deploy
and then select deploy target as Mobile Services.Alternatively, you can select MDK: Redeploy in the command palette (View menu>Command Palette OR press Command+Shift+p on Mac OR press Ctrl+Shift+P on Windows machine), it will perform the last deployment.
Tap Update on the Main page, you will see a New Version Available pop-up, tap Now. You will now see the main page as the Overview page where your First Name, Last Name and User Id are displayed in the header section and a section with various items to navigate across different areas to see the page content.
Android | iOS |
---|---|
You've now the Side Drawer Navigation page as the Main page to navigate within the application.
Continue to - Exercise 6 - Add a User Menu Section to the application