openui5
openui5 copied to clipboard
Ability to retrigger formatter function when bound to a navigation property oData v4
OpenUI5 version: 1.96.1 Browser/version (+device/version): Microsoft Edge Version 101.0.1210.39
Steps to reproduce the problem:
- Bind a navigation property to a formatter function
- Binding has to be set to OneTime for it to work as mentioned in this GitHub issue: [https://github.com/SAP/openui5/issues/3039]
- Now update the binding, it does not refresh because "OneTime" binding mode had to be set on the binding for it to work
What is the expected result?
Need some way/workaround of being able to update or retrigger formatter function execution despite the "OneTime" property being set.
Hi @will1467 ,
As the name states, "OneTime" binding mode will probably run thought the formatter function one time, as there will be no more binding updates.
Can you illustrate your issue with a JSBin example so we can better understand the use case?
Best Regards, Hristo
Hello @will1467 ,
I also tried the same way, but facing the same issue on updating the bindings on refresh of items. Did you find any solution for this ?
Regards, Arif
Hello!
What is it you are trying to achieve in the end, on UI? Maybe a custom control could do the job.
Best regards, Thomas
Hello @ThomasChadzelek, As per my use case, I am using a entity model which has navigation to other entity called 'customer'. So in the UI part we have two screens i.e Overview screen and detail screen. In the overview screen we have one table which contain details of visit data which has one column for customers name. So the problem occurring on the refresh on customer details column data(overview screen) whenever we are doing any changes in the detail screen. The customer details column are not refreshing because the binding mode is set to 'OneTime' . I tried to change the binding mode to 'TwoWay' but didn't work and got the error 'Accessed value is not primitive '. Please find the reference of the issue in the link below : [https://github.com/SAP/openui5/issues/3039]
Regards, Arif
Hello @ArSidd480 !
I'm a bit confused now as 3039 has been closed successfully?!
"one column for customers name" I still do not see why you need a formatter for that. Maybe it helps if you show the formatter's code. But please keep in mind that you can easily use relative bindings, e.g. <Text text="{_Customer/Name}"/>
. You could even combine multiple properties, like <Text text="{_Customer/FirstName} {_Customer/LastName}"/>
.
Best regards, Thomas
Since there is no response from the author for more than 4 weeks I'm closing the ticket.