Review Page UI and App Variables
  • 10 Jan 2023
  • 4 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Review Page UI and App Variables

  • Dark
    Light
  • PDF

Article summary

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:

7 Page 2_4 Review page in App Designer of EdgeReady PlatformI-24: Review page in App Designer of EdgeReady platformA 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

FunctionalityComponentApp VariablesData Type
View list of batchesGo to Home PageHeaderTable
Option to select batchesCheckboxHeader.FlagNumber (0/1)
View Batch NameTextHeader.BatchNameString

View Count associated with each batch

TextHeader.CountNumber

View Status of each batch Valid Statuses include: Unsynced, Submitted to SAP, Deleted

TextHeader.StatusString

button against each batch

ButtonHeader.Enable

String (True/False)

A button to send selected batches to server

Button-NA-
Go to Home PageButton-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: 

33 Snippet 2-1 Review - PageShow eventI-25: Review - PageShow event

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: 

34 Page 2_4 Review - How to map value for a selected checkboxI-26: Review - How to map value for a selected checkbox

Review -> button_details -> click event 

On click of the Details button against a batch, the assigned Interactions will do the following: 

  1. Take user to the Details page of the corresponding batch
  2. Persist only the selected batch object from Header variable

View the Interactions property of Details button in the screenshot below:

35 Page 2_4 Review - How to set Interactions for Details button-NewI-27: How to set Interactions for Details button 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 SourceVariableData Type
Header.BatchNameselected_BatchNameString

Table 2-2: Variable Populated in the List view item event

36 Snippet 2-2 Review - listview item clickI-28: Review - listview item click

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: 

37 Snippet 2-3 Review - Move to SAP button click eventI-29: Review - Move to SAP button click event

Note that some business function variables are used to enable Progress bar while posting selected batches to server. 

Refer table below:

App VariablesType
boolShow_progressbar

String (True/False)

status_progressbarString
perc_progressbarDecimal

Table 2-3: Variables to enable Progress bar

The above mentioned variables are mapped in the Progress bar properties as shown below.

40 Image progressbar_sendSelectedBatchesI-30: Progress bar properties

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:

41 Snippet 2-6 Review - button_back on click eventI-31: Review - button_back on click event

 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:

50 BOS 1-1 BOS_initiateMoveToSAP - Input VariablesI-32: BOS_initiateMoveToSAP - Input 

Variables

51 BOS 1-2 BOS_initiateMoveToSAP - Post transaction dataI-33: BOS_initiateMoveToSAP - Post transaction data 
52 BOS 1-3 BOS_initiateMoveToSAP - If post failed, update Batch Status (with the batch table as Output variable) and terminate the BOSI-34: BOS_initiateMoveToSAP-If post failed, update Batch Status(with the batch table as Output variable) and terminate the BOS 





Was this article helpful?

ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence