Cannot nest from 'TreeNode' inside itself

I tried to create a tree with a recursive repeating panel and I failed.

The form TreeNode is not available in the item_template drop down of a RepeatingPanel inside the TreeNode form itself.

At this point I thought it would never work, but I kept trying, so I tried to create another form TreeNode2 and use that as item_template in the RepeatingPanel inside TreeNode, then use TreeNode as item_template in the RepeatingPanel inside TreeNode2, but I got the error Cannot nest from 'TreeNode' inside itself.

Is there a way to create a “recursive” RepeatingPanel?

The recursion would not be infinite because the form would only show the first level and load the next level on demand, when the user clicks on the parent node link. (Well, it would potentially be infinite, but only after an infinite number of clicks).

I used a grid for my tree. This allows for 11 levels of indenting. But then, I’m not expecting to get anywhere near that deep with it.

Hi Stefano,

Happy New Year! Still catching up from the archives, as you can see :slight_smile:

You might be interested in seeing how we do it in the Secure Download Portal example app. Specifically, we work around the issue by manually instantiating one of the subforms.

Hope that helps!

Hi Meredydd,

Thanks for your answer.

When you use the word issue, you mean it’s an issue you intend to fix or it’s a little limitation that makes no sense to fix because there is a different/better/more anvillista approach like the one you mention from the download portal?

It’s a design feature. It is a tradeoff - so far, it’s proved useful in preventing accidental infinite loops, and there is still a straightforward way of doing what you want to do here, so we’re keeping it that way for now.