In a web application, each element has a set of triggers. With their help, you can configure various business processes that will start under certain conditions.

All elements have a set of common triggers called the element life cycle:

  • onCreate – runs when the element is created on the page;
  • onShow – runs when the component changes its state to visible (displayed on the page);
  • onHide – runs when the component changes its state to hidden (stops being displayed);
  • onDestroy – runs before the component is destroyed.

Here are the triggers on the button element as an example:

Here are the triggers on the button element as an example

Let's take a closer look at each trigger. We will use Notification blocks to display the launch of triggers in the interface to do this.

onCreate

Let's start with the onCreate trigger and set up a notification for it.

onCreate trigger and set up a notification for itNow, the Notification will appear every time the onCreate trigger runs. It will work in the following cases:

  1. When the user visits the page;
  2. After page refresh.

Let's set up similar BPs for other triggers:

onShow

The onShow trigger will run:

  1. When the user enters the page, and the element's Visible field is set to True;
  2. After refreshing the page, and the element's Visible field is set to True;
  3. When an element changes its Visible state from False to True.

onHide

The onHide trigger will run:

  1. When the user leaves the page the element was on.
  2. When an element changes its Visible state from True to False.

onDestroy

Trriger onDestroy

The onDestroy trigger will run:

  1. When the user leaves the page the element was on.
  2. When an element is removed from the page.
Was this article helpful?

AppMaster.io 101 Crash Course

10 modules
2 weeks

Not sure where to start? Get going with our crash course for beginners and explore AppMaster from A to Z.

Start Course
Development it’s so easy with AppMaster!

Need More Help?

Solve any issue with the help of our experts. Save time and focus on building your applications.

headphones

Contact Support

Tell us about your problem, and we’ll find you a solution.

message

Community Chat

Discuss questions with other users in our chat.

Join Community