Reactive Programming Model Flashcards
Which of the following events is NOT available in Screens or Blocks?
A. Initialize
B. Ready
C. After Fetch
D. Render
C. After Fetch (This is an Aggregate event, not a Screen event)
Considering the Initialize event of a Screen, which of the following would be the BEST use case for that event?
A. Retrieve data from the server database.
B. Act on data returned by a Data Action.
C. Manipulate the DOM.
D. Set the default value of a Local Variable.
D. Set the default value of a Local Variable.
What is a primary reason for using the On Ready event instead of On Initialize for certain actions?
A. On Ready
is triggered before any data fetching, making it faster.
B. On Ready
allows you to access and manipulate the DOM.
C. On Ready
can be used to set input parameters of Blocks on the screen.
D. On Ready
always executes before any user interaction with the screen.
B. On Ready allows you to access and manipulate the DOM.
Which of the following is the CORRECT order of occurrence of events in a Screen?
A. Initialize, Ready, Render, Destroy.
B. Initialize, Destroy, Ready, Render.
C. Ready, Initialize, Render, Destroy.
D. Initialize, Render, Ready, Destroy.
A. Initialize, Ready, Render, Destroy.
When does the On Destroy event of a Screen trigger?
A. Immediately after the On Initialize
event of the next screen.
B. Before the On Ready
event of the next screen.
C. After the screen transition to the next screen is complete.
D. When the user closes the browser window.
C. After the screen transition to the next screen is complete.
Why might the On Render event be triggered multiple times during a user’s interaction with a screen?
A. Because the user is rapidly clicking on different elements of the screen.
B. Because the screen contains multiple Aggregates that fetch data independently.
C. Because changes in data or screen elements can trigger a re-rendering of the screen.
D. Because the On Render
event is automatically triggered every few seconds.
C. Because changes in data or screen elements can trigger a re-rendering of the screen.
In which scenario is the On After Fetch event particularly useful?
A. When you need to validate user input before submitting a form.
B. When you need to perform calculations based on data fetched by an Aggregate.
C. When you need to redirect the user to a different screen based on fetched data.
D. When you need to set the default value of a dropdown widget based on the first record in an Aggregate.
B. When you need to perform calculations based on data fetched by an Aggregate.
Which event is the BEST place to handle logic that needs to run after all data has been fetched and the screen is fully displayed to the user?
A. On Initialize
B. On Ready
C. On Render
D. On Destroy
C. On Render (though keep in mind it might run multiple times)
What is a key difference between Screen Events and Block Events?
A. Screen Events only handle user interactions, while Block Events handle data changes.
B. Screen Events are triggered on the client-side, while Block Events are triggered on the server-side.
C. Screen Events define the lifecycle of a screen, while Block Events allow for communication between a block and its parent.
D. Screen Events can have input parameters, while Block Events cannot.
C. Screen Events define the lifecycle of a screen, while Block Events allow for communication between a block and its parent.
What is the BEST way to prevent a user from accessing a screen if they are not authenticated?
A. Use the On Destroy
event to redirect them to the login screen.
B. Check their authentication status in the On Initialize
event and redirect if necessary.
C. Hide the screen elements that require authentication using conditional visibility.
D. Display an error message in the On Ready
event if the user is not logged in.
B. Check their authentication status in the On Initialize event and redirect if necessary.
Which of the following events is triggered when the screen starts rendering, but before it is visible to the end-user?
A) Initialize
B) Ready
C) Render
D) After Fetch
B
In which event can you safely manipulate the DOM since it is already loaded but not yet visible to the end-user?
A) Initialize
B) Ready
C) Render
D) Destroy
B
What is the best use case for the On Render event?
A) Set default values for variables
B) Add JavaScript listeners to DOM elements
C) React to changes in the data and update the UI accordingly
D) Redirect the user to another screen
C
What event should you handle to clean up DOM changes or remove JavaScript listeners when a screen is about to be destroyed?
A) After Fetch
B) Render
C) Destroy
D) Ready
C
What is a typical use case for the On Initialize event of a Screen?
A) Set JavaScript listeners on the DOM elements
B) Handle the data returned from an Aggregate
C) Set default values for Local Variables
D) Clean up resources before the screen is destroyed
C