Main Menu
Function
The Main Menu module is the first screen a user sees after launching the application, and provides a basic choice of the three main workflow options available:
Screen Female Client: to launch the female client screening form: Screen Client.
Follow Up with Existing Client: to find the record for an existing client and launch the appropriate follow up form (the Existing Client List module).
Send Data: To launch the synchronization interface and sync the database with the server: Send Data.
Implementation
This is the first screen a user sees, which would usually imply that its html file is assets/index.html
. However, this application is embedded within the larger Tables Sample Application, which claims the index.html
file. That demo launches assets/hope.html
, which defines this screen. If this application were extracted from this sample application and deployed on its own, this file would need to be renamed index.html
.
This file creates its HTML <body>
dynamically with embedded JavaScript. This JavaScript defines the three buttons:
Screen Female Client: Calls
odkTables.addRowWithSurvey(...)
to launch the screenClient form. Notice that the database table being written to is femaleClients which is shared among other forms. See the Follow Up Forms module implementation details.Follow Up with Existing Client: Calls
odkTables.openTableToListView(...)
to launch the Existing Client module.Send Data: Calls
odkCommon.doAction(...)
to launch the SyncActivity. This is the same functionality as pressing the sync button in the upper right of the screen, but with two advantages.
The call is embedded within the custom workflow of the application so the user can be instructed to use it at the appropriate time.
The
doAction
function supports the Action-Callback workflow, which means further actions could be triggered after synchronization is completed.
Files
assets/hope.html
Forms
None
Database Tables
None