Visibility and layout is not working when using Tree / recursive for iterating a datasource

The tree / recursive feature seems to be broken in more than one way. The following layout shows some of the problems I’ve experienced. The first image shows how it looks when I loop a list of files and folders twice using “Repeat content”. On the top there is logic to format the list different depending on the type of file or if it’s a folder. The yellow is a simplified version of the same content showing only the name and what appfarm returns on Iterator Param - Recursion Level (0 when using Repeat Content)

This is what happens when I change the Iteration variant to Tree / Recursive :

In the list using visibility logic, many of the items will simply disappear.
While the yellow list ignores any layout settings like alignment, sizing or flow direction. This list should flow vertically, not horizontally. Recursion Level seems to be correct.

The example is inside a dialog. The layout for the yellow list is as follows:

The layout looks correct in create on all screen sizes. It’s in dev it’s broken (and probably also in production)

I have finally found a solution to the problem, in case someone else experiences the same. It seems that the behavior iterating containers using Tree/Recursive behaves different from iterating containers using Repeat Content. When you set flex layout = vertical on the repeating container using Repeat Content, the next level container can have flex layout = horizontal and still be listed vertically. If you change the repeat logic to Tree / Recursive, the sub container will be listed horizontally even when flex layout = vertically. The solution in case you want the list to be vertically (a tree view/indented list) is to introduce another container between the one with horizontal layout and the iterating container. This container needs to have flex layout = vertically.

There might be a perfectly logical explanation to why this happens but it’s still confusing. The Recursive tree example at Appfarm Showroom uses a different logic and was not of much help in my case.

1 Like