ASSOCIATE-REACTIVE-DEVELOPER practice question 22 of 35

On Parameters Changed is from Parent to Block while Event Handler is from Block to Parent.

Full set: 262 questions
Answer options
A: True
B: False
Correct Answer:
T; R; U; E
Explanation

The statement accurately describes the two primary mechanisms for communication between a parent element (like a Screen or another Block) and a child Block in OutSystems Reactive Web Apps. OnParametersChanged (Parent to Block): This is a predefined event handler within a Block. It is automatically triggered whenever the value of an input parameter, passed down from the parent, is changed. This allows the Block to react to data changes initiated by its parent. The flow of information is from the Parent to the Block. Event Handler (Block to Parent): A developer defines a custom Event within a Block to signal that something has occurred (e.g., a user clicked a button inside the Block). The Block then triggers this Event. The parent element must implement an Event Handler action to "catch" this signal and execute logic in response. This constitutes communication from the Block up to its Parent.

Why Incorrect

The alternative option, "False," is incorrect because the described directions of communication are fundamental to the architecture of reusable components (Blocks) in OutSystems Reactive applications. Reversing these roles would contradict the established and documented design pattern.

References

1. OutSystems Official Documentation, "Block Events": This document explicitly details the communication from a Block to its parent. It states, "Trigger events in a Block to pass information to the parent Screen or Block." It further clarifies, "To handle a Block Event, you need to define an Event Handler Action in the parent Screen or Block." This confirms the "Block to Parent" direction for Events and their Handlers.

Source: OutSystems Documentation, "Block Events", Section: "Handle a Block Event".

2. OutSystems Official Documentation, "Lifecycle Events for Blocks": This document describes the OnParametersChanged event. It specifies, "This event handler runs when the value of one or more of the Block's input parameters change." Since input parameters are set by the parent, this change originates from the parent, confirming the "Parent to Block" communication flow that triggers this event.

Source: OutSystems Documentation, "Lifecycle Events for Blocks", Section: "OnParametersChanged".

3. OutSystems Guided Path, "Becoming a Reactive Web Developer", Course: "Reactive UI Development 101", Section: "Blocks and Events": This official training material reinforces the concept. The lesson "Communicating with Events" states: "Events are a way for a Block to notify its parent about something that happened." The lesson "Reacting to Parameter Changes" explains that the OnParametersChanged event is triggered inside the Block when a parent changes the value of an input parameter.

Source: OutSystems Training, Guided Path: "Becoming a Reactive Web Developer".

Scroll to Top