In this how-to, you will create and configure the home page as well as the new and edit pages.
This how-to will teach you how to do the following:
- Build the to-do app pages
Before starting this how-to, make sure you have completed the following prerequisite:
3 Creating the Home Page
When users open the to-do app they will land on the homepage of the app. Follow these steps to create and configure the home page:
- Right click your newly created ToDo module and select Add > Page.
- Go to the Phone specific tab of the Create Page wizard.
- Enter Home_Phone_Default for the Page name.
- Verify that Phone_HeaderOnly is selected for the Navigation layout.
- Click Blank in the sidebar menu and select the Blank page template.
- Click OK to create the page.
- Open the project’s Navigation, click the Hybrid phone app online tab, and set the Default home_page to Home_Phone_Default from the ToDo module.
- Under Menu, change the Home menu item so that it also directs to Home_Phone_Default.
4 Configuring the Home Page
Let’s create the user interface for the home page so that it shows a list of available to-do’s. Follow these steps to set up the user interface and connect it to the new entity in the domain model:
- Open Home_Phone_Default you’ve just created in the ToDo module.
- Change the page title to My to-do’s in the Properties pane.
- Delete the Layout grid from the page.
- Right-click the area you just cleared and select Add widget > List view to add a List view to the page that will take the place of the layout grid.
- Right-click the List view and select Select data soure.
- For Entity (path), click Select and select the ToDo entity.
- Click OK and then Yes to automatically fill the content of the list view.
- Delete the Completed attribute.
Double-click Sort order: (default) and add the DueDate attribute with the Ascending sort direction.
Great! You can now see a list of to-do’s on your home page, but only after you have created them. Let’s configure a page to create to-do’s.
Users also need to be able to add new to-do’s to the list, that’s why you’re going to add a page that lets them do this. Follow these steps to create a new and edit page:
- Add a Create button widget to the button placeholder on the top-right of the page.
- Select the ToDo entity in the pop-up.
- Right-click the New button and select Generate page.
- Select the Form Default template and click OK.
- Right-click the New button and select Go to page.
Delete the Completed attribute.
Run the app locally. Click Save and continue if you did not save your page(s) yet.
Click Yes to create a default database if this is asked.
Open the View drop-down menu and select Hybrid Phone App Online.
This is an easy way to see your app. There is also a way to simulate the touch behavior of a user on a mobile device. This is explained later in step 4 of this how-to.
For the next step in this series, move on to How to Create a Mobile To-Do App Step 3: Improve the Look and Feel of the App.