Edit Dialog

Contents Hide

 

Edit Dialog

Edit dialogs will provide the ability to modify a data table through providing a form with multiple controls for user input. An edit dialog can add new records to the table or modify an existing record in the data table. An edit dialog can also be used to view a record in the data table in a read-only mode disallowing any editing of the data. Thus when an edit dialog is to be opened, the context in which it is to open must be set through creating form links and the form link editor window. For more information refer to the Form Links chapter.

Data Table

Similarly for list dialogs, you can bind the data table which will be modified through this edit dialog. You can also create the table of which will be binded by selecting the '<Bind to New Table...>' option in the drop down menu.

The behaviour of the edit dialog can also be changed by adding auto saving the record when the form is closed. If the form has been opened in the context of adding a new record to the data table with this behavioural option enabled, when the form is closed, the current values in the fields will be added as a new record in the data table. While if this form is opened in the context to modify a record with this option enabled, the record will be values entered in the form will be auto saved back into the data table. The option can be enabled by ticking the checkbox next to 'Auto save record on form close'.

Form Behaviour on Close

Within edit dialogs, further options are available to dictate the behaviour of the form dialog when the form is to be closed. Application designers currently have the ability to auto save what has been entered in the form into the specified data table. This feature can be enabled by the 'Auto save record on form close' option. If the form was opened in the context to add a new record to the data table with this option enabled, then a new record will be added to the data table comprised of what had been entered into the fields. If the edit dialog was instantiated to modify an existing record, if this feature is enabled and the form is closed, then any changes made to the field values will be updated into that record in the data table. By providing this functionality, mobile applications can be made with simplicity and user friendly with minimal amounts of screen taps.

The edit dialog may also be defined to prompt users to save any unsaved data when the edit form dialog closes, using the 'Prompt user for unsaved record on form close' option. This feature can only be enabled when auto saving of records option is disabled. If this option is enabled and field value/s have changed from what they have been instantiated with, the user will be prompted with a message asking to confirm the close (where a 'Yes' response will close and save the values, and 'No' will close and discard values). The message displayed to the user may be modified by the 'User Prompt' field under this check value.

Form Validation

In addition to the above On Close options, the 'Configure Validation Rules' button may be tapped to open the validation panel. Here, rules for fields may be established which will be evaluated on close; if these are not met, the user will be prevented from saving records in the form. Right clicking the table, or tapping the 'Add New Validation Rule' will insert a new entry for a validation rule. Initially, this rule will display with a red border, indicating it is incomplete.

Tapping on the ellipsis () in the 'Rule' column after selecting the row will open the Validation Rule Editor to specify the condition. The message displayed to the user if the rule is not met is specified in the 'Message' column.

Display Fields

Once a data table has been binded to the dialog, the edit dialog editor will be populated with display fields that correspond to the columns in the selected table. In the edit dialog editor, columns from the data table can be added and removed from the table definition. Also columns can be included or excluded from the form.

Additional fields maybe also be added, which may be used within the form to capture and/or display more data to the user.

Creating a new field will display a new field dialog, where the type may be specified. This will create a new edit field with name based on the type - for example, if a Camera type is to be added, its name would be 'CAMERA1' etc.

For each selected field, multiple options will appear. These are:

When adding fields, except for the 'Yes/No' type, it will have a identifying label named as '<FIELD NAME>_Label' and every field will have a data control where its data is stored named with the field name. The form values for the dialog will be all the data controls for each field. Form value names will be in the form of '<DIALOG_NAME>.<FIELD_NAME>'. For information about what each form values are available for each type are stated in the 'Field Types' section below.

Field Types

Each field in the edit dialog will have a type indicating what data can be stored in the field. When assigning the type, the WYSIWYG window will update with the controls associated with that types. For example a field with type 'Camera' will add a label, scribble and button control to the form.

By selecting a component on the WYSIWYG window, its properties will populate the properties window where the user can alter its properties. Certain types will display additional options which may also be set.

Field Type Description
Record ID A type to indicate the field is the unique identifier for a record. These should be used when viewing or adding a new record into the data table. Hence the 'Load Data From' and 'Save Data To' properties should be set to the unique record identifier of the bound data table. A new option will appear to the user where they can indicate the type of the record ID. These types include:
  • Next Number: Field will be using the next available number from the last record in the data table. Field must be an integer or string.
  • Unique Number: Field will be set to a unique number to the data table. Would be used when the unique record identifier column is of type integer (int). Field must be an integer or a string with length > 10.
  • Unique String: Field will be set to a unique string to the data table. Would be used when the unique record identifier column is of type string. Field must be a string whose length is > 36.

By adding a field of this type, it will automatically add a label and edit control to the form. This field is designed for ID fields which must be generated on the form. If a constant or contextual value is to be used, this field should be set as a Calculated field.
 


Form Value Name Description
Edit Control value Contains value of the corresponding edit control.
 
Text Assigning a field the type of 'Text' means the field will accept text into the edit control. Fields of this type should be used when user input in the form of text is required. The 'Text' type will add a label and a edit control to the form.



Form Value Name Description
Edit Control value Contains value of the corresponding edit control.
 
Numeric Assigning a field to the 'Numeric' type dictates the edit control added to the form will accept integer values. This type will automatically add a label and a edit control. The edit control added will have its 'Number' property ticked indicating the control will only accepts numeric entries.
  


Form Value Name Description
Edit Control value Contains value of the corresponding edit control.
 
Label By selecting the 'Label' type, it will add two labels to the form. Where the <Field Name>_Label control will be used to identify the other/data label where data can be entered. (E.g. Field Name = 'LABEL', identifying label will be name 'LABEL_label' and the data label will be named 'LABEL'). A field with label type will should typically be used for displaying data.


  
Label field types will have no form values.
Drop List This type indicates the field will be a drop down list where users will be able to choose an entry from the list shown. By adding this field, a label and a combo box control will be added. There are 2 types of drop list fields, static and dynamic. These types dictate where the items of the list will be produced from.

  • Static List: A drop list with this type will allow developers to add a static list of items to be used assigned in development time. By clicking the new 'List Entries' option, the items to be shown in the list can be added.

  • Dynamic List: The drop list can also be instantiated with items from the column values of a data table. Hence items in the list can be dynamically added as the data table changes. If this is set as its type, the data table and column in which the item values will come from must be specified through the provided drop down menus.

Form Value Name Description
Combo box selection Contains value of the currently selected item in combo box.
 
Yes/No This type will add a check box control to the form. The check box will be used to indicate yes or no where if the check box is ticked indicates yes and unticked for no. Another option will appear that will allow the default value of yes (i.e. the check box is ticked initially).


Form Value Name Description
Check box control value Holds the value of check box. Either TRUE if ticked or FALSE if unticked.
 
Date The purpose of the 'Date' field type is to allow input in the form of dates. In order to set the format of the date, the user will be able to set the 'Date Style' through the drop down menu available. The available styles are:
  • Short Date: A DateTime Picker control where a user can choose a date that is displayed in 'MM/dd/yyyy' format.
  • Long Date: Date is displayed in 'Day, dd Month yyyy' format on DateTime Picker control.
  • Custom: User can set their own format. By pressing the button, a help window will appear detailing the rules and available format strings that can be used in the custom style.
  
The 'Date' type will add a label and a DateTime Picker control.



Form Value Name Description
DateTime Picker Value Contains chosen date from DateTime Picker control.
 
Time The 'Time' type will add a label and a DateTime Picker control where the user can set the time to be entered into the DateTime Picker control.
  


Form Value Name Description
DateTime Picker Value Contains chosen time from DateTime Picker control.
 
Image By setting the field to the 'Image' type will add a label and a image control to the form. By clicking the button, the user has the ability to set the image to be shown in the image control. However the image binary can be loaded from a data column by using the 'Load Data From' option.
  

  
Field types with the 'Image' type will have no form values. However the image control's value are available within the local scope of the form found when used in a calculated field under 'This Form' branch of the data source..
Signature The 'Signature' type will provide controls to the form allowing users to enter and capture signatures. A label, signature and button control will be added. The signature control is where the user can enter signatures while the button control will be used to allow users to clear the data in the signature control.
  

  
Similarly to the image field type, signature types will have no form values however the signature control value is available within local scope of the form. Hence the signature control can be used within a calculated field.
Camera Assigning a field to the 'Camera' type will allow the user of the application to open the camera and capture an image. By adding a field of this type will add three controls, a label, a scribble control and a button control. The button control will facilitate opening the camera interface on the device to allow capturing of an image. The scribble control will house and display the image captured from the camera. The users also have the ability to 'Allow Markup' where the captured image can be marked on.


  
The camera type has no form values. The signature control added to the form however can be used within the local scope of the form.
Barcode By selecting the 'Barcode' type for a field will add a label, edit control and a button control to the form. These controls will be used to provide barcode scanning to the application. Before using this functionality a barcode scanning application must already be installed on the device. Using the button provided, users will be able to open the barcode scanner application installed on the device in order to capture barcode data and save it into the edit control.
  


Form Value Name Description

Barcode data

Barcode data captured and stored in edit control
 
GPS Latitude The 'GPS Latitude' type is used to capture the current latitude coordinates using the GPS capabilities available on the device running the application. By pressing the button that is added automatically, the current latitude coordinates will be saved into the edit control. GPS services should be enabled on the device.
  


Form Value Name Description
Latitude value Edit control will hold the latitude value.
 
GPS Longitude Similarly to the 'GPS Latitude' type, the 'GPS Longitude' type is used to capture the current longitude coordinates using the GPS services available on the device. The type will add three controls, a label, edit control and a button. When the button is pressed, the current longitutde coordinates will be added to the edit control. GPS services should be enabled on the device.



Form Value Name Description

Longitude value

Edit controls value. Will hold longitude data.

Calculated The 'Calculated Phrase' type will indicate the field is a calculated phrase. A calculated phrase is a mathematical expression that be created from form values available from all forms in the application, settings available in the application and constants and objects made available by BrightBuilder. By click the calculated phrase box will open the 'Calculated Phrase Editor' window that will provides users the ability to formulate their phrase.
  


The window provides the data sources that can be used to formulate the phrase:
  • This Form: Provides the controls available with the currently opened form
  • Other Forms: Displays the form values from other form dialogs available
  • Settings: If settings have been added to the application through a Settings dialog, the persisted settings values can be found under this branch.
  • Constants: Constants defined by the user can be entered here and used in the phrase. String, boolean, integer, double and DateTime constants can be defined.
  • Objects: Object methods are also available to be used in the calculated phrase. For example the CreateDate method under the DateTime object is available. To find out the Object methods available please refer to the Object Methods Reference chapter.

By dragging and dropping these data sources and the mathematical operators available into the statement line, the phrase can be constructed. A Calculated Phrase field will add a label and a edit control. When the form is opened, the edit control will be instantiated with the value obtained from the calculated phrase.
Form Value Name Description
Edit Control value Edit control's value. Value will be set to calculated phrases output.
 
Action Button A field with this type will add a button control to the form. This button will be used to carry out an action. In order to use this type, the buttons type must be set. The button can be assigned these types:
  • Open Form: This indicates the button will open another form. What form will be opened can be assigned by creating a connection between the edit dialog and the desired form to open in the Application Panel. What form that will open when the button is pressed can be specified through creating a form link from the edit dialog to another and specifying the action to this button.
  • Save Record: Depending on the context the edit dialog was opened, when the button is pressed it will either create a new record to be added to the data table or update the data table with the modified record. To dictate if the dialog will 'CREATE a new item' or "MODIFY an existing item', it will need to be explicitly set when creating the form link. Using the fields with their 'Save Data To' options set, these fields will be used to generate the record that will be added/modified.
  • Save Record and Close Form: A button with this type will behaviour similarly to buttons of type 'Save Record'. Additionally to save a new record or updating a record in a data table, the edit dialog form will close and return back to the parent dialog that opened the edit dialog.
  • Save Record and Open Form: With addition to saving a new record or updating an existing record in the data table, when a button of this type is pressed, another form can be opened. The form to be opened can be specified by creating a form link from the edit dialog to the child dialog to be opened.
  • Delete Record: When the button is set to this type and is pressed, it will delete the current record that is displayed when the form has been instantiated with a specific record from the data table.
  • Reload Record: When a form has been opened with the context of modifying a record in the data table and a button of this type is pressed, the form currently opened will be refreshed with the original record values and any modifications will be lost. If the form has been opened to add a new record into the data table and this type of button is tapped, the form will be refreshed with the initially values for all fields.
  • New Record: When a button of this type is tapped, the form will be opened again in a new context. The edit dialog will be opened in the context to add a new record to the data table.
  • Close Form: When a button with this type is pressed, it will close the current form dialog opened. Once closed, the application will return and open the parent dialog that opened the edit dialog through a form link.
  • Synchronise: The 'Synchronise' button type indicates the button will run the currently enabled Sync Rules in the application when pressed.