Recursive components

Happy new Year!!

Is it possible to create recursive components using weweb?

I would like to display the whole structure of a file system containing folders within folders (or files within folder)

I would appreciate very much any resources available.

Hi,
yes this is possible, the only limitation is that the recursion cannot be more than 10 (this is a security limitation for accidental infinite loop)
You just have to define your differents inputs/params, and then drag and drop a component instance inside itself and bind the children input with your logic :slight_smile:

Hello, @aurelie. Thank you for the response. I think I got it almost right. but I can’t figure out how to collapse all children when the parent collapses, as shown in the video below. I would like it all to collapse, and when I expand a parent again, the child should expand only if I ask it to collapse when clicking the button. Do you have any idea how I could go about it?
ezgif.com-video-to-gif-converter

Hmm using conditional rendering on the children component should do what you wish? You can bind it to your ‘collapsed’ internal variable

I am creating a flow chart to set actions for IA robot. O have created a simple interface, but sometimes, depending on what users a creating we reach the recursive limit.

Is there an approach to overcome that? Or s solution to create chart like this on weweb?

Last time I did this, it worked. I thibk your setup might be wrong and causing recursion.

I didn’t figure out a different approach. I hava a Json with actions where each actions has a property setting the next action. I have created a component design for a actions that calls itself if the property “next_action” is not empty.

The point is that weweb does not allow if you have more than 10 levels to prevent infinity looping, but I need much more levels to be able to create my flows.