-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catching events for nested components #898
Comments
Each component defines how it routes events.
In your case, the problem was using: Component frame = Renderer([&]{
return window(text("Example UI"), display->Render());
}); instead of: Component frame = Renderer(display, [&]{
return window(text("Example UI"), display->Render());
}); So, you create a brand new Component, without forwarding events to |
Thank you for the prompt reply! |
@MarcelFerrari Have you been testing around to get an answer to your question already? Would be interested in an answer! |
Hi everyone,
I am trying to understand how the CatchEvent decorator interacts with components and with the Render() method.
I am writing a program that has multiple tabs containing lots of information and I have split each tab into its own class. Each class has a construct() method which returns a Component object containing all the data representing that tab. This component may contain CatchEvent decorators that are only relevant for that specific tab. However, it seems like events are not forwarded to child components whenever the Render() method is called.
I include a small example to reproduce the issue.
This code works absolutely fine
This one however fails to register the catch event calls:
From what I understand calling the Render() method transforms components into "static" elements before any events are caught and handled.
How can one go about achieving the functionality I want?
Many thanks in advance,
Marcel
The text was updated successfully, but these errors were encountered: