cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hello experts,

I am currently trying to find a solution for keeping the state (expanded / collapsed) of nodes from a sap.ui.table.TreeTable after saving changes done to TreeTable entries to the BE.

Scenario: I have a TreeTable binded to an OData v2 webservice with operationMode='Client' on SAPUI5 v 1.52.13. There are different properties of the TreeTable entries that can be changed by users (e.g.: a user can set a new price for an entry in the table).

The issue: After saving the changes done to the TreeTable entries, the table is triggering a request to the BE to reload the data. At this point, the state of the TreeTable is reset. The nodes that were expanded or collapsed are restored to their initial state.

Looking into the corresponding SAPUI5 documentation I noticed there is a binding parameter called treeState. To me, this seems to be a possible solution for not losing the expanded / collapsed state of the nodes after saving changes.
The problem that I have is that the documentation is vague and I can't find any examples of how this parameter could be used.

The following are unclear to me:

  • how do I get access to the ODataTreeBindingAdapter; I need this so I can call getCurrentTreeState for "snapshotting" the TreeTable state before save
  • what should actually be passed for treeState? The documentation mentions a boolean variable, but if I look into the TreeBindingAdapter, it seems that treeState should actually be an object with some specific functions.
  • Is there any way to create a TreeState object besides using getCurrentTreeState from ODataTreeBindingAdapter?

Thank you and have a good day!
SePo

0 Likes
View Entire Topic
sergiu_popa
Participant
0 Likes

Hi Fabrice,

I figure out what happens... the TreeTable that I expected to have this method is inside a SmartTable. It seems that the bindings of TreeTables inside SmartTables don't get this method as long as enableAutoBinding = true.

Thanks!

Have a good day!
SePo

Fabrice
Active Participant
0 Likes

Hi,

sorry that i cannot help you more.

Have also a good day!

Fabrice