I’m working with a “Reusable Component” that needs to receive data from its parent component. I see that handlers such as “Styles Logic” , allow to bind properties directly from the “Inherited Data Model” without any issues.
However, when working with “event handlers” like “On Click Event”, the “Inherited Data Model” is not available, only Page Data, App Data, and Layout Data are accessible.
Could you guide me on how to access the “Inherited Data Model” within an event handler using Codeless? Or, if that’s not possible, how can this be done using JavaScript as a workaround?
I’m using a “Reusable Component” multiple times on the same page, and each instance needs to have a different “Inherited Data Model”. However, I can’t access this data inside event handlers like “On Click Event”.
Storing it in “Page Data” or “App Data” is not a solution because each instance needs its own separate data.
How can I access the “Inherited Data Model” while keeping each instance independent?
Also share please app id, container and page name where your issue is reproduced. If it required additional actions like login, please create test one for us.
Just found this topic of 2023 which is exactly what i´m talking about:
Seems Alex was able to find a workaround, but i don´t fully understand how to implement it. I enable the data container in a block of the reusable component but then… Could you please explain step by step what i need to do in the reusable component and in the page parent container (origin of the inherited data model)?
I´ve created an example where 2 different blocks use the same reusable component in order to perform a simple math operation. The idea is for the reusable component consider the input provided in its parent block (deta container enabled). Could you please help solve this puzzle?
I fix your test page, but this fix is like a ‘hack’ and is not expected behavior for me.
I will ask somebody to find better solution. Do not delete the test page pls