openui5
openui5 copied to clipboard
Missing ECD Samples
I got curious about the Extended Change Detection mechanism.
A quick google search yielded no samples, are there any that I am missing?
For developing controls, aggregation modifier methods have to be implemented and without samples we are left with only the default ones in the source code of e.g. sap.m.ListBase.
Also, in order to have bDetectUpdates === true, a template has to be provided (as per source code) Why?
@dfenerski sorry for not yet answering your recent comment in #1162 . I wanted to check with colleagues whether we have some code sample, but AFAIK, the documentation chapter is all we have, besides the controls that implement ECD.
Wrt. bDetectUpdates: one idea of ECD is to reuse clones inside an aggregation. If a binding uses a factory function, not a template, then this function is opaque for the framework. It's not clear whether property updates in the bound data might result in a different return value of the factor function. Therefore, bDetectUpdates is set for a binding with a factory function (note that the code checks for !oBindingTemplate). The list binding then will deep check the values to detect inner updates and will execute delete + insert operations rather than reusing the old item. This, btw, is mentioned in the above ECD docu:
... This is especially relevant when a factory function is used to create child controls, so depending on the data a different control may be created by the same entity.
Thanks for the info!
It would be great if we could have a sample.
In the meantime, if I find the time needed to put one together myself, I can post it here (perhaps a codepen or something similar).
Hello @dfenerski , Thank you for sharing this finding. I've created an internal incident 2180423470. The status of the issue will be updated here in GitHub. Regards, Florian
Hello @dfenerski, we discussed the issue and we will handle this topic in the backlog item CPOUI5FRAMEWORK-340. Thank you for bringing up this topic.
Hello @flovogt ,
Has there been any progress on this issue ?
Thanks and BR
Dimitar
Hi @dfenerski , no progress so far. We have prepared and planned the topic. Currently, topics with a higher priority are in work. I can not promise any timeline for finishing this backlog item.