You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

New Feature

New feature added in Joget DX :

  • Do not load subform in the background when it is collapsed or hidden option 


Introduction

AJAX SubForm gives you the flexibility of dynamically loading a Subform by attaching a listener to another form field. 

Data to load by the AJAX Subform

The target's form Load Binder will be executed to fetch record matched from the properties defined in AJAX Subform.

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

Get Started

The easiest way to see how the AJAX Subform works is to create a new app. Here are the steps:

StepsScreens (Click to view)
  1. Start Joget Server and open the App Center.

  2. Log in as admin and click on the Design New App button. (see Figure 1)

  3. Fill up the App Details as follows and click Save (see Figure 2):
      1. App ID: ajaxSubform
      2. App Name: AJAX Subform


  4. You will be directed to the Design App. Click on the Create New Form button and fill up the Form Details as follows (see Figure 3):
    1. Form ID: formA
    2. Form Name: Form A
    3. Table Name: as_a


  5. Click on Save and you will be directed to the  Form Builder.

  6. Drag and drop a Text Field element on to the canvas.

  7. Hover the mouse over the Text Field element on the canvas and click on Edit to open up the Edit Text Field properties.

  8. Fill up the Edit Text Field  properties as follows and click on OK (see Figure 4):
      1. ID: name
      2. Label: Name
  9. Click on Save on the Form Builder.

  10. Click on Generate App, select Generate CRUD and click OK (see Figure 5)

  11. Once the App Generator is complete, click on the link to launch the userview.

  12. Click on New button and Save at least 2 records of data (see Figure 5)

  13. Head back to the Design App.

  14. Click on the Create New Form button and fill up the Form Details as follows (see Figure 6):
    1. ID: formB
    2. Form Name: Form B
    3. Table Name: as_b


  15. Click on Save and you will be directed to the  Form Builder. 

  16. Drag and drop a Select Box element on to the canvas.

  17. Hover the mouse over the Select Box element on the canvas and click on Edit to open up the Edit Select Box properties.

  18. Fill up the Edit Select Box properties as follows and click on Next (see Figure 7):
    1. Label: Choose record from Form A
    2. Or Choose Options Binder: Default Form Options Binder


  19. Fill up the following details in the Edit Select Box and click OK (see Figure 7):
    1. ID: field1
    2. Form: Form A
    3. Label Column: name


  20. Drag and drop an AJAX Subform element on to the canvas.

  21. Hover the mouse over the AJAX Subform element on the canvas and click on Edit to open up the Edit AJAX Subform properties.

  22. Fill up the Edit AJAX Subform properties as follows and click on Next (see Figure 8):
    1. Form: Form A


  23. Tick the first three checkboxes and click Next (see Figure 8)

  24. Fill up the Edit AJAX Subform properties as follows and click on OK (see Figure 8):
    1. Parent Field to keep Subform ID: field1


  25. Click on Preview and select between the records in the Select Box to see the Subform dynamically loads the appropriate record.

 

Figure 1


 

Figure 2


  Figure 3


Figure 4

Figure 5


Figure 6


Figure 7


Figure 8


AJAX Subform Properties

Edit AJAX Subform 

NameDescriptionScreens (Click to view)
IDElement ID (By declaring as "view_existing_claim", a corresponding database table column "c_view_existing_claim" will be created)

LabelElement Label to be displayed to the end-user.
Form

Target Form to be loaded.

Usage of Hash Variable

The use of Hash Variables inside the target form is permissible but may be limited due to the nature of how the form is loaded.

Example 1: One can use #requestParam.primaryKey# to access the record ID.

Example 2: One can use #form.tableName.fieldId[{requestParam.primaryKey}]# to access field value of the given record ID.

UI

General

NameDescriptionScreens (Click to view)
Reload SubForm when Parent Field value change?

Dynamically reload the subform when parent field value changes.

Parent Field value here refers to the

Parent Field to keep Subform ID setting in the next tab.

Readonly

Determines if the element is editable.

Display field as Label when read-only?

Displays the value of the element as plain text when element is set to "Readonly".

Display without frame?
Decorator option. Removes default styling applied to SubForm when checked.
Collapsible?
Make the AJAX Subform collapsible.


Collapsible Setting

NameDescriptionScreens (Click to view)

Collapsible?

Make the AJAX Subform collapsible.

Label when expanded

Label when expanded

Label when collapsed

Label when collapsed

Expanded by default?

Expanded by default option.

Hide when no value?

To hide the AJAX Subform when there's no data to be loaded.

Do not load subform in background when it is collapsed or hidden

To not load the subform when it is collapsed or hidden.

New Feature

Newly introduced in Joget DX 7


Data & Binder

Data Linkage

NameDescriptionScreens (Click to view)
Parent Field to keep Subform ID
The ID of the field in the parent form to store the SubForm table's primary key. SubForm data will be loaded based on the record ID retrieved from this field.

Subform Field to keep Parent ID

The ID of the field in the SubForm form to store the parent table's primary key.

Store Binder 

By default, the Workflow Form Binder plugin is used for loading and storage of form data in the AJAX Subform, you may override it with other plugins.

Important

The target form's Store Binder will not be executed. The Store Binder selected in this property will be executed instead.

See the list of available Form Binder.


Binder

NameDescriptionScreens (Click to view)
Store Binder 

By default, the Workflow Form Binder plugin is used for loading and storage of form data in the AJAX Subform, you may override it with other plugins.

Important

The target form's Store Binder will not be executed. The Store Binder selected in this property will be executed instead.

See a list of available Form Binder.


Related Video Tutorials



Download Demo App

APP_AjaxSubform_dx_kb.jwa

  • No labels