- 10 Jan 2023
- 4 Minutes to read
- Contributors
- Print
- DarkLight
- PDF
Review Page UI and App Variables
- Updated on 10 Jan 2023
- 4 Minutes to read
- Contributors
- Print
- DarkLight
- PDF
The Review page is used to display the batches of records (i.e., logs). The logs added in one session are grouped into a batch.
The End-User can do the following actions in the Review page:
- View the count of records under each batch
- Click the ‘Details’ button of a batch to view and manipulate its records
- Select one or more batches and send it to the server
The following image shows the UI design in Review page:
A list view component is used to display the list of batches. Each list item has the following components:
- Check box (for selection). The Data for the checkbox is designed as described in Review Page Scripts: Review -> checkbox -> click event
- Text fields (to display Batch Name, Batch Status, Batch Count)
- Button (to navigate to Details page)
Since this page displays all batches and its associated count of records, it makes use of a table data structure with BatchName and its associated Count. There are additional columns like Flag, Status and Enable included to build logic on this page. These columns would be explained under section Review Page Scripts: Review -> button_moveToSAP -> click event
Functionality | Component | App Variables | Data Type |
---|---|---|---|
View list of batches | Go to Home Page | Header | Table |
Option to select batches | Checkbox | Header.Flag | Number (0/1) |
View Batch Name | Text | Header.BatchName | String |
View Count associated with each batch | Text | Header.Count | Number |
View Status of each batch Valid Statuses include: Unsynced, Submitted to SAP, Deleted | Text | Header.Status | String |
A button against each batch | Button | Header.Enable | String (True/False) |
A button to send selected batches to server | Button | -NA- | |
Go to Home Page | Button | -NA- |
Table 2-1: App variables in Review page
Review Page Scripts
On clicking the Review menu from the bottom bar, all batches created in this device are shown.
Review -> onPageShow event
In the onPageShow event, the count of records under each batch is computed and updated in the ‘Header’ variable. As discussed in section Review Page UI and App Variables, the Header variable is mapped to the List View component in Review page. The following images shows a script snippet:
Review -> checkbox -> click event
When the checkbox in the Review screen is selected, the checkbox value is mapped to Header.Flag. No script is necessary. Observe the Selected property of the checkbox in the screenshot below:
Review -> button_details -> click event
On click of the Details button against a batch, the assigned Interactions will do the following:
- Take user to the Details page of the corresponding batch
- Persist only the selected batch object from Header variable
View the Interactions property of Details button in the screenshot below:
Review -> list item click event
Additionally, as required for the App logic, it will be useful to copy the BatchName of a selected batch into a primitive business function variable. Therefore the following variable is introduced and its value is populated in the List view component’s item click event.
Data Source | Variable | Data Type |
---|---|---|
Header.BatchName | selected_BatchName | String |
Table 2-2: Variable Populated in the List view item event
Review -> button_moveToSAP -> click event
On clicking the ‘Move to SAP’ button in Review page, the BOS_initiateMoveToSAP is invoked and it posts the selected batches to the server.
As part of App logic, the batches sent are disabled for further selection/changes (Header.Enable), Status is updated as ‘Submitted to SAP’ (Header.Status) and the selection is reset from one to zero (Header.Flag). Header.Enable is mapped to Enabled property of checkbox and Details button in Review page. This disables these two components against the batches submitted to SAP, therefore preventing re-selection and preventing navigation to Details page to avoid adding/updating/deleting the already submitted records.
Refer the following script snippet for the logic:
Note that some business function variables are used to enable Progress bar while posting selected batches to server.
Refer table below:
App Variables | Type |
---|---|
boolShow_progressbar | String (True/False) |
status_progressbar | String |
perc_progressbar | Decimal |
Table 2-3: Variables to enable Progress bar
The above mentioned variables are mapped in the Progress bar properties as shown below.
Review -> button_back -> click event
On clicking the back button in Review page, the End-User is shown the Home page where the user can add logs to the current batch. On navigating to Review page or Details page, the active BatchName might have changes based on user actions. Therefore, it is necessary to reassign current BatchName (BatchName_current) back to BatchName. However, if BatchName is empty at this point, it means the active batch was moved to SAP through Review page or is Deleted through Details page. In that case, the Home page is loaded with BatchName as empty and the appropriate app flow is undertaken to re-initialize App variables for a new batch.
Refer the following screenshot for button_back script:
Developing Business Logic BOS for Review Page
BOS_initiateMoveToSAP
This BOS posts all Logs under one selected batch to the server. Refer Appendix C for Database schema of table that will store the transaction data. Refer screenshot below for Input variables, Post operation and Error handling: