You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
So, you create a brand new Component, without forwarding events to display.
The second form does "decorate" the wrapped component, by overriding only its "Render()" function, but still forwarding everything else.
Thank you for the prompt reply!
I understand now. I looked up the documentation and found the Component Renderer(Component child, std::function<Element()> render) function. In the case of multiple children, e.g. when rendering multiple components into a vbox, I assume it is possible to wrap all the child components into e.g. a stacked container in order to propagate events, even if the container is not rendered itself, right?
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: