webblock loopback

webblock loopback

When I wan to use a webblock inside a webblock (recursive use) I got a message "Webblock loopback detected"
The basic idea is to have a foldertree but not using the treeview object :-)

How do I do this ?

In the meantime looking at this: http://www.jstree.com/

Yep, no recursion for WebBlocks or Structures.

Maybe you could create a structure with all the item fields you need, like ImagePath and Label, and add two attributes: Id and parentItemId. Then create an action to generate HTML dynamically, going through all the items in the record list, searching for childs for each node etc etc. . You can use recursion with Actions.

If you're willing to go a bit out of your way, what I did once, facing a similar problem was develop a class in .NET (where I could use recursion), and return a serialized version to Outsystems. I had a method for adding nodes (using those Id and parentItem attributes), wich in turn would return an updated serialized version of the class. When the tree was ready, I had a getHTML method that would, internally deserialize the binary, and generate HTML that I could use on a page.
This is what I used it for:

If anyone has a better solution to overcome recursion limitations, I would be very much interested to learn how that can be done in a cleaner way.