Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction


English

Form Grid extends the default functionalities of a typical grid element.

Unlike the generic grid element that only accepts standard text field for its inputs, the Enhanced Grid Form Element captures data by making reference to another form element.

Hence, one can take full advantage of what a typical form element has to offer, e.g., validation and formatting.

The Form Grid is only available on Professional and Enterprise Edition.

Get Started

The easiest way to see how the Form Grid works is to use the existing built-in App Expenses Claims and create a new form to mimic an existing form in the app. Here are the steps:

...

...

  1. Start the Joget Server and open the App Center.

  2. Log in as admin and click on the pencil icon on the Expenses Claim to open the Design App. (see Figure 1)

    Image Added
    Figure 1

  3. Under FORMS column, click on Expense Claim Form (see Figure 2)

    Image Added
    Figure 2

  4. Drag and drop the  Form Grid  element on to the canvas.

  5. Hover  the mouse over the Form Grid element on the canvas and click on  Edit  to open up the Edit Form Grid properties.

  6. Fill up the Edit Form Grid  properties as follows and click on  OK (see Figure 3):
    1. ID:  entries
    2. Form:  Expense Claim Entry
    3. Columns : 

      Field ID*

      Label

      Format Type

      dateDateDate
      categoryCategory
      purposePurpose
      amountAmountDecimal

    Image Added
    Figure 3

  7. Click on  Preview  to open up the Preview tab, click on the plus sign on the Form Grid and it will open up a popup displaying the Form that it was referred to. (see Figure 4)

    Image Added
    Figure 4

  8. Open up Expense Claim Entry and note the Field ID's are the same as written in the Edit Form Grid. This is how the Form Grid displays the data from said target form. (see Figure 5)

Image Removed

Figure 1

Image Removed

Figure 2

Image Removed

Figure 3

Image Removed

Figure 4

Image Removed


  1. Image Added
    Figure 5

Form Grid Properties

Edit Form Grid

Image Added

NameDescription
ID

Element ID (By declaring as "entries", a corresponding database table column "c_entries" will be created)

Please see Form Element for more information about defining the ID and list of reserved IDs.

LabelElement Label to be displayed to the end-user.
FormTarget form to refer to.
Columns

The columns defined here must be correspondent to the Form chosen above.

NameDescription
Value

Field ID of the form element to refer to the target form.

Panel
borderColorblue
borderWidth1
titleBGColor#ddffcc
borderStylesolid

Example:

In "HR Expense Claim Entry" form, there are Form Elements with the ID "date", "category", "purpose", and "formattedAmount".

LabelColumn Label.
Format Type

If you would like to format the returned value, you may make use of the format type.

Default choice: Text.

Available Format Types

  • Text - formats the value as text
  • HTML - outputs data as HTML
  • Multiple lines text - maintains the spacing formatting for multiple lines text, such as TextArea.
  • Decimal - formats as a decimal. The number of decimals is expected in the "Format" field.
  • Date - formats as a date. Original Date and New Date formats are expected in the "Format" field.

    Panel
    borderColorblue
    borderWidth1
    titleBGColor#ddffcc
    borderStylesolid

    Format: (original format)|(new format)

    Example of usage:
    Original value:
    5/23/2012
    Expected value: 2012/5/23
    Format :
    M/d/y|y/M/d

    Note: Please refer to Java SimpleDateFormat for date format.

  • File - Show the value as a link to the attachment. Form

Def
  • ID is expected in the "Format" field.

    Info
    title
Expected Form Def ID
  • Important Infomation
    1. Specify the Form
Def
    1. ID that contains the actual File Upload form element.
    2. Make sure that you use Multirow Form Binder as the Load Binder.
    3. The file will be downloaded as an attachment and do NOT actually follow the properties set at the target form's File Upload properties.
  • Image - Show the value as a thumbnail of the attachment. Form

Def
  • ID is expected in the "Format" field.

    Info
    titleExpected Form
Def
  • ID

    Specify the Form

Def
  • ID that contains the actual Image Upload / File Upload form element.

  • Options - Show the label of a multiple-choice element given the value given. Form

Def
  • ID is expected in the "Format" field.

    Info
    titleExpected Form
Def
  • ID

    Specify the Form

Def
  • ID that contains the actual Select Box / Radio / CheckBox form element.

FormatDepending on your chosen Format Type, an additional argument may be entered here.
Width

Column width in characters.

Code Block
titleSample
200px

UI

Sorting

Image Added

Image Removed
NameDescriptionScreen (Click to view)
Enable Sorting Feature

Determines if the ordering of rows is to be enforced

.

.

The property fields "Enable Sorting Feature" and "Field ID for Sorting" stores the form grid record row sequence, meaning it records which ID sits in row 1, row 2, and so on and rearranges it back in this same ascending sequence on load binder.

If you are using this property, key in a unique field ID in "Field ID for Sorting" property . This field ID must *not* be an existing field in your form which you use for your form data. Typically we use the field ID "sort" and Joget will automatically create this column in your database table (Do not use the field ID "sort" anywhere else in your form).

If you need automatic sorting on another column value when loading the form grid/spreadsheet, use Load Grid Data with Custom Sorting and Filtering or JDBC Form Binder with the "ORDER BY ASC" SQL statement.

Field ID for SortingField to keep the ordering sequence; must correspond with a field id (i.e. hidden field) to keep the sequence number (i.e. 0,1,2,3,4) in the target form.


Form

Image Added

Image Removed
NameDescriptionScreen (Click to view)
Form Submit Button Label (Normal Mode)The label of the Submit button in normal mode.
Form Submit Button Label (Readonly Mode)

The label of the Submit button in read-only mode.

Display field as Label when readonly?Displays the value of the element as plain text when an element is set to "Readonly".
Popup Dialog Height

Specifies the height, in characters.

Code Block
titleSample
200px
Popup Dialog Width

Specifies the width, in characters.

Code Block
titleSample
200px


Grid

Image Added

Image Removed
NameDescriptionScreen (Click to view)
Readonly

Determines if the element is editable.

Disable Add FeatureDetermines if a new row can be added.
Disable Delete Feature

Determines if a row can be removed.

Delete confirmation messageConfirmation message when deleting a row.
Show Row Numbering?Shows numbering on the grid.
Paging SizeItems to be displayed per page.

Validation & Data Binder

Validation

Image Added

Image Removed
NameDescriptionScreen (Click to view)
Validator

Attach a Validator plugin to validate the input value. Please see Form Validator.

Info
titleWhen will validation takes place?

Validation will take place whenever a form is submitted except when it is submitted as "Save as Draft".

Unique ColumnColumn/Field ID to identify record ID.
Min Number of Row Validation (Integer)
Min Number of Row Validation (Integer)
Max Number of Row Validation (Integer)
Max Number of Row Validation (Integer)
Error Message
Error message to be shown when row requirements set above is not met.


Data Binder

Image Added

NameDescriptionScreen (Click to view)
Load & Save Binder

Load Binder allows you to customize the method for data retrieval to populate the multi-row form grid in the form.

Save Binder allows you to customize the method on how the form grid row records are saved to.

This option is empty by default. An empty binder means that the form grid records will be saved/loaded as a JSON format in the parent form & database table. See the list of available Form Binders.

The recommended binder to use is the theMultirow Form Binder so so that each record is saved into a child database table via a subform definition. The binder will update the foreign key "parent id" into each child record to point to the parent database table.

Image Removed


Child Form Data Deletion Options

Image Added

NameDescriptionScreen (Click to view)
Delete Associated Grid Data?

If the popup form has a grid element(s), this option will delete the inner grid data.

Panel
borderColor#ffa700
borderWidth1
titleBGColor#ffdb99
borderStylesolid
titleCaution

These 3 options: (Delete Associated Grid Data, Delete Associated Child Form Data, Delete Files), in combination, does apply to nested grid/child elements.

These options traverse the entire form tree. Upon encountering a 'false' condition, it will move on to the next grid/child element.

Example: Consider that the popup form has a form grid, form grid has a subform, subform has a file upload element with abc.pdf. If all options are checked, abc.pdf will be deleted. If all except ONE of the options is checked, abc.pdf will NOT be deleted.

Image Removed

Delete Associated Child Form Data?

If the popup form has a child element(s), this option will delete the child data.

Panel
borderColor#ffa700
borderWidth1
titleBGColor#ffdb99
borderStylesolid
titleCaution

These 3 options: (Delete Associated Grid Data, Delete Associated Child Form Data, Delete Files), in combination, does apply to nested grid/child elements.

Delete Files?

If the popup form contains a file upload element, this option will delete the actual uploaded file(s).

Panel
borderColor#ffa700
borderWidth1
titleBGColor#ffdb99
borderStylesolid
titleCaution

These 3 options: (Delete Associated Grid Data, Delete Associated Child Form Data, Delete Files), in combination, does apply to nested grid/child elements.

Abort Related Running Processes?If there are process instances related to the deleted row, these options will abort those process instances.

...

Related Tutorials

...

Info
titleLearning More

Download a tutorial app on Grids from Joget Workflow Marketplace to learn more.