openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Support last item selector in XML property binding: {demoModel>/array/-1/title}

Open piejanssens opened this issue 4 years ago • 4 comments

This would be a useful enhancement. By using '-1' we could allow selecting the last element from an array in a property binding.

piejanssens avatar Aug 19 '21 09:08 piejanssens

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

unazko avatar Aug 19 '21 10:08 unazko

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

SvBe avatar Aug 20 '21 05:08 SvBe

Just a remark: reminds me to and would be consistent with the new Array.prototype.at.

codeworrior avatar Aug 20 '21 06:08 codeworrior

ping @piejanssens

flovogt avatar Jul 26 '22 06:07 flovogt

Since there is no response from the author for more than 4 weeks I'm closing the ticket.

flovogt avatar Aug 25 '22 11:08 flovogt