openui5
openui5 copied to clipboard
Support last item selector in XML property binding: {demoModel>/array/-1/title}
This would be a useful enhancement. By using '-1' we could allow selecting the last element from an array in a property binding.
Hello @piejanssens,
Thank you for sharing this finding. I've created an internal incident with ID: 2180361328. The status of the issue will be updated here in GitHub.
Regards, Boyan
Hello piejanssens,
I will discuss your new requirement with our product owner. Can you explain the use case in more detail? Of course with that kind of item selector you could address elements in a JSON model collection directly in a property binding. But this would be only a special case for JSON models. For ODataModel this kind of addressing would not work.
For such cases you could also set for example the context of the last entry in you list as the binding context of a form in which your property binding with a relative path is contained.
Regards, Sven
Just a remark: reminds me to and would be consistent with the new Array.prototype.at.
ping @piejanssens
Since there is no response from the author for more than 4 weeks I'm closing the ticket.