Recursive Tree Update Issue

Hi everyone,

I’m working on this recursive tree to display a hierarchy and came across what I belive is a bug. The tree should let users open and close nodes to show or hide their children. I’m using a boolean variable “Make visible” to control whether an element should be visible or not. All the logic is in place and works fine, but the tree doesn’t update after the logic has run.

I’ve set up the Iteration container with the data source, parent identifier, and a filter to include only items with “Make visible” set to true. Here’s a screenshot of what I’ve got: Screenshot 2024-01-09 at 11.33.34

As the filter option didn’t help, I tried messing around with a visibility rule on the child-container and using conditional filters, but no luck. I’m currently able to update the tree by forcing the app to jump to another view, hang out for like 50 ms, and then come back. But this isn’t great for user experience, since it scrolls the page back to the top every time as well as flashing the page I’m temporarily navigation to.

Any ideas on how to get this tree to update in real-time without the whole page-hopping scenario?

Hi Kaspar,

Thank you for your question.

Do you have the setting “Subscribe to Updates” enabled on the Departments (Result) object? This is a setting available in “Data” which can help to show live updates to the data without needing to reload the user interface.

Thanks
Rhys

Hi @rhys

Thanks for the suggestion. However, the ‘Departments (Result)’ data source is runtime only. Below is the setup we’re using where the runtime property ‘Make visible’ is what we’re filtering on to include only relevant objects.

Understood! Have you tried making an ‘On Click’ event for the recursive tree, and updating the “make visible” boolean in that action? If the boolean is updating but the recursive tree still doesn’t update, then this sounds like a bug.

Rhys

That’s exactly the issue. The logic running sets the ‘Make visible’ property correctly but the recursive tree doesn’t update. I have to load a new view and navigate back for the changes to be displayed.

Thank you for clarifying, I have reported this as a bug internally.

Rhys

Hello!

I have tried the excact same setup, and it works as expected. It is thus not a general issue, but something in your view or app that affects this behaviour, or some minor details in your setup that has not been stated. Coult you copy that repeating tree into a blank view as a starter, to see it the issue appears there as well? or maybe into another App? Can you also provide a screenshot of the UI tree structure such as this, to see where you have put the action (updating the “Make visible” property)?
image

That will help narrow down the issue to what’s causing this issue in your setup.

Just a quick follow up question: Is this setup inside a view, dialog, drawer or popover?

Hi @kristian

I’ve copied the tree into a blank view and retried but are still experiencing the issue. Below is a recording where you can see that the runtime property ‘Make visible’ are toggled when the action fires but that the view doesn’t update. I’ve ensured that the action itself have the ‘Skip render’ option disabled.

Here’s the new setup for the test in the blank view: