cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5: rerender only a single node of sap.ui.commons.Tree

christian_heinz
Discoverer
0 Kudos

Hi everyone,

anybody knows if it is possible to rerender only single nodes of a sap.ui.commons.Tree?

I have a sap.ui.commons.Tree which provides a couple of functions to the user and which is bound to a json model. After user interaction i want to update the chosen TreeNode on which the user performed the function by updating it's model data. This works fine so far with

oModel.setProperty(sPath, oValue, oContext, bForceUpdate)

The problem is, that after setting the new property, the whole tree structure starts rerendering, even if i set bForceUpdate to false.

Any ideas how to rerender just that single node that changed?

Thanks in advance,

Accepted Solutions (1)

Accepted Solutions (1)

christian_heinz
Discoverer

Solved this. For those who have a similiar problem:

Using sap.ui.commons.Tree and a factory function to bind nodes is leading to this problem. Tree inherits the function "updateAggregation()" from the superclass ManagedObject. In this function there are the following lines, that are destroying the current aggregations.


if (oBinding instanceof sap.ui.model.TreeBinding) {
             if (!oBindingInfo.template) {
                this[oAggregationInfo._sDestructor]();
            }
            updateRecursive(this, oBinding.getRootContexts());
        }

After overwriting this function for my custom control, it workes without rerendering the whole Tree.

Answers (0)