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

Compare with Current View Page History

« Previous Version 39 Current »

New Feature

This is the new feature in Joget DX 8.

Introduction

Component Events enables interactions between page components with event triggering and event listening using AJAX, a technology that allows web pages to communicate with a server behind the scenes. This means that specific parts of a web page can update or exchange data without requiring the entire page to reload, making the user experience more seamless and responsive.

Where to Configure

Component Events are configured in a Page Component Property called "Ajax & Events".

It can be found by first visiting the UI Builder > (your selected page) > "Edit Page Components".

Figure 1: Location of the "Edit Page Components" button to get to the Ajax & Events property menu.


Then, from the Editing Page Components screen, select your Page Component to bring up the Properties menu. The Ajax & Events property menu can be found at the end.

Figure 2: Location of the Ajax & Events property menu.

Example - Meeting Date Management

Expected Outcome

When a user clicks on the "Edit" button, a "Edit Meeting Details" form appears below the table without reloading the entire webpage.

Then, when the user clicks on the "Save" button after updating a row of data, the table gets updated with the corresponding values.

Figure 3: The expected outcome through the proper implementation of a component event.


You may learn more about Component Events by visiting the Joget DX Showcase application in the App Center, then clicking on New In DX 8 > Component Events.

Figure 4: How to get to the Component Events showcase in the Joget DX Showcase application.


Note

The Joget DX Showcase app is a default app that can be found in every fresh installation of Joget DX 8.

Required Components

Application-Level

No.ComponentNameImage (For Reference)
1FormCalendar - Meeting

Figure 5: The Form component relevant to the Meeting Date Management example from the App Composer.


Figure 6: The Form component relevant to the Meeting Date Management example from the Form Builder.

2ListList - Calendar - Meeting

Figure 7: The List component relevant to the Meeting Date Management example from the App Composer.


Figure 8: The List component relevant to the Meeting Date Management example from the List Builder.

3UIJoget DX 8 Showcase

Figure 9: The UI component relevant to the Meeting Date Management example from the App Composer.


Figure 10: The UI component relevant to the Meeting Date Management example from the UI Builder.

Page Component-Level

Note

This section does not include details on the Ajax & Events property configuration. It can be found in a later section to assist with clarification.

No.ComponentConfigurationImage (For Reference)
1CRUD
Component PropertyFieldValue
Configure CRUDLabelManage Meeting
ListList - Calendar - Meeting
Form (Add)Calendar - Meeting
Form (Edit)Calendar - Meeting
UI (List)Show Delete Button?(checked)
Delete Associated Grid Data?(checked)
Delete Associated Child Form Data?(checked)

Figure 11: The general configuration of the CRUD component.


Figure 12: The UI (List) configuration of the CRUD component.

2Form
Component PropertyFieldValue
Configure FormLabelManage Meeting
FormCalendar - Meeting
Display Field as Label When Readonly?(unchecked)
RedirectionURL Redirect on Cancellation?close=true

Figure 13: The general configuration of the Form component.


Figure 14: The Redirection configuration of the Form component.


Ajax & Events Configuration

The process to set up the Meeting Date Management system is broken down into 3 sets:

  1. Hiding the Form by default.
  2. The corresponding Form shows when the "Edit" button is clicked.
  3. When the "Save" button is clicked-
    1. The table reloads with the new data.
    2. The Form becomes hidden.

Before you proceed, please make sure all the required components mentioned in the previous section has been set up.

To enable the Component Events feature, check the "Handle Component with AJAX?" field in the AJAX & Events.

If any of the Ajax & Events configurations do not take effect, please restart Joget.

Event Set 1: Hiding the Form by Default

Form Component

Form LabelValue
Handle Component with AJAX?

(Checked)

Note

Checking this label will enable the following sub-properties.
Event Listening
Row 1Component Object
Main Menu Component
Event Name *page_loaded
Matched ActionHide Component

Explanation

The Main Menu Component listens for a 'page_loaded' event. When the event is triggered, it hides the Main Menu Component component object.


Figure 15: The Ajax & Events configuration of the Form Component in the Event Listening section.


Event Set 2: The corresponding Form shows when the "Edit" button is clicked.

CRUD Component

Form LabelValue
Handle Component with AJAX?

(Checked)

Note

Checking this label will enable the following sub-properties.
Event Triggering
Row 1
Event Name *load_form
Trigger Method *Link Clicked

Parameters Changed Rules

RowParameter Name *OperatorValue
1_modeEquals Toedit
 
When Not Match Trigger Event Namehide_form

Explanation

When the Edit button is clicked, the "_mode" parameter becomes equal to "edit", which triggers the "load_form" event.

When the Trigger Event name doesn't match "load_form", then the "hide_form" event is called.


Figure 16:The Ajax & Events configuration of the CRUD Component in the Event Triggering section.

Form Component

Form LabelValue
Event Listening
Row 1Component Object
Manage Meeting
Event Name *load_form
Matched ActionShow and Change Component URL Parameters

Parameters *

RowParameter Name *Parameter Value
1id{id}
2closefalse
3_modeedit
4_actionedit

Explanation

Upon receiving a call for this event, the Manage Meeting Component Object will Show and Change its Component URL Parameters to the set values.


Figure 17: The Ajax & Events configuration of the Form Component in the Event Listening section.


Event Set 3(a): When the "Save" button is clicked - The table reloads with the new data.

Form Component

Form LabelValue
Event Triggering
Row 1
Event Name *reload_table
Trigger Method *POST Request

Explanation

The Form triggers a "reload_table" event via a POST Request.


Figure 16:The Ajax & Events configuration of the CRUD Component in the Event Triggering section.





template

Form LabelValue
Handle Component with AJAX?

(Checked)

Note

Checking this label will enable the following sub-properties.
Event Listening
Row 1Component Object
Main Menu Component
Event Name *page_loaded
Matched ActionHide Component

Explanation

The Main Menu Component listens for a 'page_loaded' event. When the event is triggered, it hides the Main Menu Component component object.


Figure 15: The Ajax & Events configuration of the Form Component in the Event Listening section.

Event Triggering
Row 1
Event Name *load_form
Trigger Method *Link Clicked

Parameters Changed Rules

RowParameter Name *OperatorValue
1_modeEquals Toedit

These parameters are required to trigger the "Link Clicked" Trigger Method.

For instance, in this context, when the parameter name "_mode" is equals to "edit", then the "Link Clicked" Trigger Method is triggered.

When Not Match Trigger Event Namehide_form

Explanation

When the "Link Clicked" trigger method is activated, it initiates the "load_form" event.

  • No labels